function has_post_format( $format, $post = null ) {}

Check if a post has a particular format


  • string $format: The format to check for
  • object|id $post: The post to check. If not supplied, defaults to the current post if used in the loop.

Return values

returns:True if the post has the format, false otherwise.

Source code

function has_post_format( $format, $post = null ) {

	return has_term('post-format-' . sanitize_key($format), 'post_format', $post);



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: