You could do this pretty easily with a simple query:
global $wpdb;
$results = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE '%carousel%'");
foreach($results as $result){
//$result->post_id will give you the original attachment post
}
Related Posts:
- Access to Media Library
- Get link of inserted media file of post within loop
- change the_content images for different sizes (Desktop, tablet, mobile)?
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- How to get Author ID outside the loop
- Media library to list images only user uploaded
- remove tags from the_content
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- Why do themes rely on “The Loop”?
- How to hide media uploads by other users in the Media menu?
- How to place comments_template(); outside the loop?
- Endless loop with wp_insert_post and wp_update_post
- Hook into the loop via a plugin, and output something after every X post?
- Two custom loops, pagination, offset
- Getting two wp_link_pages output
- post loop causes wp_users and wp_usermeta DB queries for each users
- Ajax loop refresh on click
- Run The Loop over array of post objects
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Enable infinite scroll on single.php [closed]
- Is get_posts() more efficient than The Loop?
- loop through all posts memory error
- Site icons with alpha channel for self-hosted WordPress blog network
- Redirect Loop to Page, Can’t Find Origin, Can’t Remove [closed]
- Post Format single-loop.php using get_template_part
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- Display posts from multiple user roles
- Display content of page template (get_page)
- How do I get row padding in a post feed?
- Display the_content on click jquery
- Missing image in gallery shortcode in custom feed
- Including post thumbnail url in loop’s post object to reduce number of queries
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Searching for any images in media library displays “no media found”
- Make blog page show 10 on first page, 9 on every other page
- Duplicate posts in paginated results
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- How to get file URL from media library
- Two loops on different pages do the same thing, but only one page works
- Posts active and expired in different loops
- Media library only shows for admin. Doesn’t show editor or below [closed]
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Variable not being passed into WordPress loop
- Exclude duplicated $sticky post from combined loop content
- Getting a custom field in the middle of a loop
- Pagination on Single Post
- Display Posts Only with Specific Tag
- How to get my loop to paginate?
- Get author Meta for particular user inside the loop
- Trying to get property of non-object in shortocde
- Foreach displays from last to first
- value of metadata is null wrong use of if statement
- Count post views in loop
- How to Loop with the final result formatted differently?
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Separate First Post Loop
- add offset to archive page
- Category ID returns as ‘0’?
- make get_post work in the loop
- How to display 3 post per slide
- For Each +1 WordPress Loop
- Loops for cat links not looping for wordpress site
- Skip 5 latest post while paging?
- WordPress: query pages except remove one page
- get_post_meta printing empty fields, but it shouldn’t be
- Sort posts according to a numeric value entered with ACF
- Is it possible to set archive.php instead of index.php to display blog?
- How to read taxonomy in loop?
- wp_get_attachment_url not fetching URL?
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- Undefined index: page in loop load ajax content
- how to add 4 post in one carousel slide
- How to Protect Uploads, if User is not Logged In?
- Exclude Posts Using Meta Query and User Meta
- Is “the loop” a template tag?
- Can I temporarily disable global $post?
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- Show a list of user posts in the user admin page
- WordPress with woocommerce custom query
- Page gets displayed in post field
- Active class for my flexslider in WordPress
- WordPress loop only displays 5 articles max?
- How to split my uploaded media into directories?
- get_template_part() to render single page Theme
- Can’t see custom field after the Loop [closed]
- Showing related posts (custom post type) outside of the loop
- Same Loop on Multiple Pages
- Least Number of Loops to Create Custom Homepage?
- The Loop for my theme with static front page is not working
- WordPress loop: Display if posts exist
- strange parse error when including a loop template within another template
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- Showing ads after posts in home page
- Undefined variable: woocommerce_loop [closed]
- Prevent duplicating specific column from database table
- Why some images are not allowed to be edited only for thumbnails?
- How to batch-add image file extension without losing DB refs?
- I make sticky post for my archive page for custom post type with ACF field and loop is not working