Codex

Function Reference/has post format

Contents

Description

Returns a boolean if the specified post format is assigned (true) or not (false) to the post. This will usually be called in the the loop, but can be used anywhere if a post ID is provided.

Usage

<?php $format has_post_format($format,$post_id); ?>

Parameters

$format
(string) (Required) name of the post format.
Default: none
$post_id
(integer) (Optional) ID of the post.
Default: current loop post

Changelog

Source File

has_post_format() is located in wp-includes/post.php.

Post Formats: set_post_format(), get_post_format(), has_post_format()

See also index of Function Reference and index of Template Tags.