To get all featured images belonging to a certain post type, you’d have to get all those posts and the loop through them to get the featured image. Like this:
$query = new WP_Query( array(
'post_type' => 'yourposttype',
'posts_per_page'=>-1,
));
$thumb_list = array ();
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$thumb_list[] = get_post_thumbnail_id();
}
wp_reset_postdata(); // resetting for the main query
}
Related Posts:
- Get images attached to a specific page
- Programmatically adding images to media library
- Upload images to remote server
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- How can I hide media library images from general users?
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- How do i upload an image and return the image id?
- Regenerate missing _wp_attachment_metadata
- How to make programmatic image upload generate thumbnail and sizes?
- Best way to strip character entities (%20 etc)
- Different upload path per file type
- Is there a way to get attachment data?
- Link to full size image or attachment page in photo theme
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Handling image uploads without thickbox
- Pull images from the gallery
- How to open default wp image editor screen dynamically?
- Searching for any images in media library displays “no media found”
- How to get file URL from media library
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- Why does WP allow to view and media item as a page
- Is there a way in WordPress to convert images to WebP without a plugin?
- Auto delete pictures in media library by age
- Attachments without images
- WordPress append -1 to the image name
- unsharp thumbnails after uploading image
- Post-processing of the image failed
- Unable to delete images in Media Library
- Edit image itself
- Missing Images in Uploads Directory (Server Only)
- Broken Media Library
- Media Library is not loading on grid view in admin panel
- Blurry Images WordPress 5.8.1
- Why some images are not allowed to be edited only for thumbnails?
- How can I use an image from an external source without uploading it to the media library
- Programmatically get images by URL and save in uploads folder
- What’s the proper way to find and remove duplicate images from posts and the media library?
- Separate Media Library for each user
- Get all posts (of any post type) an attachment is used in
- Insert an image into a post by API
- Function to call the attachment image from post
- Filter Media Library by author or post_parent
- Alter media caption/description conflict in WordPress?
- Separate attachment images from post loop
- Rename attachments during upload
- How to store media files in subdomain
- Why can’t I edit certain images from the WordPress Media library?
- How to add a media with PHP
- Display one random image, but only if landscape
- Getting alt text of featured image
- Get image alt attribute just by image URL
- How to change image url?
- Bulk image rotation
- get the image of the post
- How to order images in a post in WordPress 3.3?
- Audio file’s length (duration) is missing from Attachment Details in Media Library [closed]
- Change WordPress Media Manager
- Upload media files to Amazon S3
- Out of memory error reporting
- How can I attach hotlinked images in posts/pages within the same server?
- WordPress Image Attachment using remote image
- Exclude images from “inserted into post” when trying to get attachments
- WordPress automatically downscaled images larger that original
- Images attached to posts from library link to 404 error page
- Uploaded images not displaying in network site
- How to limit the number of images displayed in the media window?
- Some Images Disappeared from Media Library?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Disable image rename on upload
- What is the best way to associate multiple images to one page?
- How can i identify media uploaded to my website that is not being used anywhere anymore?
- Function to grab specific image IDs from media library.
- image URL changed in wordpress
- Fetching uploaded images using Link URL
- How to replace post image url before posting using api?
- How to get post id of first child of the same post type?
- get rid of random string before an for an image path on wordpress
- get all images from the wordpress media library with link to the post they are associated with
- Auto delete content in specific folder inside media library
- How to echo images Urls from a wordpress post, that are relally in the post
- Could creation of various image sizes cause slow form submission response?
- imported post image as normal image instead encoded image
- Updated wordpress missing image upload area
- Media Library Mess After FTP … /uploads
- Allow users to upload attachments to certain posts
- Modify media file markup output
- How can I add an “Attach image to this post/page” link on the Add Media lightbox?
- Create a custom attachment thumbnail for quick page load
- Change the image for a certain URL
- How do I embed youtube video via url in frontend posting
- Assign one featured image to multiple posts?
- Some images don’t get linked when setting link-to to media-image
- How can I hide previous_image_link() on first attachment page?
- Set padding for all content except images and few more elements
- Change image link in excerpt to point to post
- Media library only show 2 items per page?
- My image rotate 90 degree
- How can we see which posts don’t have a featured image or it doesn’t exist anymore?
- Remove one srcset entry from wp_get_attachment_image