首页 WordPress函数大全 has_post_thumbnail()

has_post_thumbnail()

2020-05-02 / 3497阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

has_post_thumbnail( int|WP_Post $post = null )

Determines whether a post has an image attached.

描述

For more information> Conditional Tags article in the Theme Developer Handbook.

参数

$post

(int|WP_Post)
(Optional)
Post ID or WP_Post object. Default is global $post.

Default value: null

返回

(bool) Whether the post has an image attached.

大家谈论
    我的见解