The featured image is stored as post meta with the key _thumbnail_id
, so you could use a meta query to get posts with a specific thumbnail:
$posts = new WP_Query( array(
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'value' => $attachment_id,
),
),
) );
Where $attachment_id
is the ID of the image.
Related Posts:
- Programmatically get images by URL and save in uploads folder
- Upload images to remote server
- Getting Images from theme’s directory in pages
- Why WordPress automatic cropping all my images?
- is it possible to replace the use of gd_lib with imagick or ImageMagick?
- How to reference a theme image in a stylesheet?
- get images from post and make a zip
- Function to call the attachment image from post
- getting uploaded SVG dimensions on front-end
- hide/protect original full-size images
- Filter Media Library by author or post_parent
- How to grab first image attached to post and display in RSS feed?
- How to add a link in a image’s caption?
- Displaying a featured image (only img url) as the img src?
- Adjusting caption below single post image
- Wrap all post images inside a div element
- When displaying the featured image, is has_post_thumbnail() necessary?
- Uploading images to Media Library fails with Memory Exhausted
- Image display from custom field
- Include captions
- Replacing image attributes (data-src) also applies to backend
- get_attachment_id() only get id of first attached image after post update
- A way to change image urls in post to cdn image url?
- What’s the proper way to use the get_image_tag filter?
- Populate a slideshow list of images from images in a wordpress page?
- Get full URL of images in media library including http://
- Host images only on CDN
- Generating different dimension images while uploading image file from custom plugin page
- How to intigrate multiple image uploader in a custom post type
- Stripping the_content() from images then displaying them seperately
- Image upload appearing as broken images following server move
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended
- Background image resets after time (XAMPP)
- renaming an image automatically everywhere else (posts and pages)
- Custom thumbnail size of image when uploaded
- Change wp-content/uploads to uploads/%postname%/%image%
- Insert File URL Links to Existing Images that Were Not Originally Linked to Themselves
- Difficulties setting a maximum image width
- Does wp_get_attachment_image_src also work with non-image files?
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Why does WP allow to view and media item as a page
- Console Browser says it cannot find a requested image that does not exist on my Website [closed]
- How to fix a missing image
- Display attached images as background-image css
- Remove Additional image sizes created by theme
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- wordpress 4.22 does not generate thumbnail images
- How to implement CSS-defined images from bootstrap site in wordpress theme
- Show Image Size as Dragging it Larger or Smaller
- Logo on the tab
- What is the best way to associate multiple images to one page?
- How can I get url from image tag in feed with fetch_feed?
- Fetch the latest post with attachment image
- How to get image name, mime type, width, height, file size from post custom field?
- How to automatically populate a gallery with images attached to posts of one category?
- How to edit caption for images and exclude it from excerption query?
- Fetching uploaded images using Link URL
- Can’t seem to see images on my machine but can on the server
- Add a span tag around image
- Plugin to select the custom image crop area
- Editing already up-loaded images
- Glitched page redirects to image
- Regenerate BIG threshold scaled images
- Change Image in Mobile Search Results
- How to change background image
- WordPress Link To Image Missing Dropdown
- get_image_tag & wp_get_attachment_image_attributes behaving strangely
- Is there a way to create referable automatic numbering in image captions?
- Issues Adding a jQuery Image Slider
- set_post_thumbnail_size only working for width
- Getting the closest named image size from an array of dimensions
- Newly uploaded images are not updating in featured image
- How to attach post ID to image links in WordPress tinymce editor
- How to stop a post from publishing if the file upload is not a image/gif
- Troubles with code for upload a image
- Duplicate images in wordpress
- My feature images are showing up twice on the preview page
- Uploaded Images not re-sized to ( Thumbnail, Medium, and Large ) size
- Custom styling Insert Media window
- How do I embed youtube video via url in frontend posting
- Some images don’t get linked when setting link-to to media-image
- Search and replace image urls in posts
- Create a Link to Larger Image from within list of smaller images
- Thickbox not displaying just the image, instead showing full page in lightbox
- Post Images Size Change in WordPress
- Show uploaded images in full size
- trouble with featured image
- My image rotate 90 degree
- Have a rotating image covering body only on front page?
- Img src path from wp-admin
- get_post_custom: get image URL instead of image ID
- I moved WordPress to root now posts go to 404
- How can we see which posts don’t have a featured image or it doesn’t exist anymore?
- Can’t manage to display an uploaded picture (uploaded from a custom button) in the front end
- Script not working in WordPress [duplicate]
- Serve images as webp if browser support
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- if user role is x – show image – wordpress
- Using medium_large image size