has_post_thumbnail( integer | WP_Post $post )
Determines whether a post has an image attached.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Optional. Post ID or WP_Post object. Default is global
Whether the post has an image attached.