The thumbnail is stored as a meta with a key of _thumbnail_id
, so that could be used to find posts that have thumbnails. Something like this:
$query = new WP_Query(array(
'meta_query' => array( array(
'key' => '_thumbnail_id',
'value' => '0',
'compare' => '>=',
)
)
));
Related Posts:
- Recent posts on homepage: different thumbnail based on logged in status and post category
- How do I get posts where image is larger than…?
- Add class name to post thumbnail
- How do you remove hard coded thumbnail image dimensions?
- How do you get the post thumbnail size?
- Setting a post’s featured image from an embedded YouTube video
- Minimum Dimensions Requirement for Featured Image?
- Display thumbnail only if requested size exists
- Delete original image – keep thumbnail?
- the_post_thumbnail responsive srcset not populating with custom image size
- Set custom name for generated thumbnails
- the_post_thumbnail hard cropping not working no matter what
- How to add multiple image sizes of the same size with add_image_size
- change set_post_thumbnail_size according to post type admin page
- Can’t extract and set SVG dimensions
- Getting Thumbnail Path rather than Image Tag
- the_post_thumbnail with lazyload JQ plugin
- Display Post Thumbnail Without Being Featured Image
- Featured Image of Video from oembed
- How to crop thumbnail height to auto with set width
- Multiple featured image thumbnails for post types (Multiple Post Thumbnails plugin)
- Image uploader with “Set Featured Image” link on front end
- adding an id to the_post_thumbnail
- How can I display my featured image correctly inside my single posts?
- Featured image upload finished hook
- Generate thumbnail for images with the same size as thumbnails
- Set post-thumbnail (with php)?
- get_thumbnail_id returns full size image
- Implementing Zurb’s Interchange Into WordPress
- can the_excerpt function also get images?
- get_pages – Display child then grandchild pages
- How to replace the_post_thumbnail template tag and show the first inside the post image instead
- How to get the image sizes, in a function, as per the sizes mentioned in the media settings?
- How to Remove Two (Related) wp_postmeta Rows?
- Resizing Images to lower Disk Space Using Plugins
- Set (featured) thumbnail for post?
- Set featured image size for a custom post type
- How to make thumbnail images click into blog posts
- display WP image posts in Bootstrap 4 modal
- Customising the size of images served in Visual Composer elements [closed]
- How to scale up post thumbnails/featured image?
- How to change the height of featured image in Twenty Eleven child theme
- Get Ancestor featured image
- how to set featured image as facebook post thumbnail
- Upload 3 different featured image sizes to WordPress
- Change size of featured image in Edit Post screen
- Cropped thumbnail still displaying as full image
- Thumbnail and Featured Image With Fixed Sizes?
- the_post_thumbnail ignores size parameter
- add_image_size not working with the_post_thumbnail
- If no featured image is set, default.png from core is shown
- Photo gallery with Featured Images
- How do i show wordpress attachments from current post?
- Need clear explanation about medias/files/attchments
- Is there a way to change a post’s thumbnail image(s)?
- Confused with the loop and repeating things
- Thumbnail Cropping with add_image_size?
- WordPress thumbnail settings change
- How to handle and keep image quality of featured image uploads
- Using concatenate with WordPress Thumbnail
- Looking for Add Title Tag on Feature Images on WP
- post_thumbnail_html only for specific thumb size
- How to automatically resize animated GIFs used as Featured Images, without losing animation?
- Is it possible to nest get_previous_post()?
- Get ID of featured image using “get_post_thumbnail_id(the_ID())” – without printing to screen?
- Exclude featured image from attachment loop
- How to not show post_thumbnail from specific category for not logged users
- Archive show thumbnail
- Exclude featured image from gallery code stops Lightbox from working
- Post thumbnail not working after regenerate
- Notice: Trying to get property of non-object when trying to get thumbnail URL
- How to write conditional for custom checkbox in featured image meta box
- Output post thumbnail (add class)
- How to set an equal image size for a Fallback Image as used for the Featured Image(dynamicly)
- How can I see where in my themes and plugins certain image sizes are used?
- Generate image for newly added size
- How do I remove featured images and captions from a wordpress RSS feed?
- Cleaning up bloated wp_postmeta table by removing multiple _thumbnail_id’s?
- Custom image size in the_content loop
- How To Add and Display Category Image
- specify size of post preview image (not post thumbnail)
- Display featured image file size, extension, filename, type, orientation?
- Video playing from featured image?
- get_the_post_thumbnail(‘thumbnail-name’) always returns empty string
- featured image inside post
- get_post_thumbnail_id /set_post_thumbnail not working
- Featured image/thumbnail fallback placeholder image
- Add class to custom thumbnail
- array set title and alt in the_post_thumbnail
- How can i hide post without thumbnails/featured images from index pages?
- How to add gallery support in WordPress?
- Get thumbnail image according to the screen
- Wanting to change presentation from full post to featured image (post_thumbnail) only
- Displaying Post Featured Images on All Pages
- get_the_post_thumbnail wordpress 3.5
- Image Alignment on Featured Images
- Trying to show link “Use as featured image” from Attachment window from t31os script
- How do WP know an image is a post thumbnail
- Featured Image Link to next post?
- Use Featured Image of Post as Header Image