has_post_thumbnail
has_post_thumbnail ( $post = null )
Parameters:- (int|WP_Post) post Optional. Post ID or WP_Post object. Default is global `$post`.
Returns:- (bool) Whether the post has an image attached.
Defined at:Change Log: - Introduced in WordPress: 2.9.0
- Deprecated in WordPress: —
Description
Determines whether a post has an image attached.For more information on this and similar theme functions, check out
the {@link Conditional Tags} article in the Theme Developer Handbook.