has_post_format()通过ID判断文章是否有指定的类型

目录

描述

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.

has_post_format() 描述

用法

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

has_post_format() 用法

参数

$format

(string|array) (必填) name of the post format or array of names of post formats.

默认值: none

$post_id

(integer) (可选) ID of the post.

默认值: current loop post

has_post_format() 参数