Before you do your output, do something like this:
$no_thumbnails = true;
foreach( $shows_sales as $p ) {
if( has_post_thumbnail( $p->ID ) )
$no_thumbnails = false;
}
Then in your loop you can do something like this:
<?php if( $no_thumbnails === true ) : ?>
<!-- Your output here -->
<?php endif; ?>
Related Posts:
- Endless loop with wp_insert_post and wp_update_post
- Add Incrementing ID to each paragraph in the_content
- post__in – Placing content from a foreach loop inside of an array
- In a foreach loop, how do I target the last item in the loop?
- WordPress loop specific thumbnail size
- How to iterate through database until it find a match
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- How can I add pagination and how can I change thumbnail size?
- Including post thumbnail url in loop’s post object to reduce number of queries
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- How to print out menu names in the foreach loop?
- post thumbnail, conditions, else wont work
- Add class to last 3 posts in loop
- Output meta into arrays
- WP Loop. If featured image is a panorama (3:1 ratio) execute some code
- Need to add class to first element in a foreach loop
- Foreach displays from last to first
- Simple foreach loop help needed in wordpress “the loop”
- Pulling in featured image into default recent posts widget
- Closing the loop…featured image variable based on post id
- How to print redux gallery feilds id? [closed]
- WordPress get post thumbnail url
- How to output thumbnail twice in a loop
- How to pick “full/thumbnail” images in the loop?
- Default featured image set as background image [closed]
- How can I access a post’s feature image outside the loop?
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- wp_get_attachment_url not fetching URL?
- Thumbnail wouldn’t scale to size properly
- Get featured image outside the loop using foreach
- Why loop renders only last metabox from array? [closed]
- Foundation modal in wordpress php loop
- ACF field not appearing correctly in loop
- Thumbnail of the latest posts page
- How to display thumbnail if post is assigned one otherwise not
- the_post_thumbnail unless video id is added
- Pages with a loop (index, archive) are loading the first image as post_thumbnail
- Eliminate duplicates in a foreach loop [closed]
- Wrap every 2 divs in row – for each loop [closed]
- ACF loops false value with repeater and checkbox
- Display Featured Image
- Place the Featured image on a post, before the first via code
- How to place comments_template(); outside the loop?
- Display thumbnail only on the very first post in the loop?
- Hook into the loop via a plugin, and output something after every X post?
- Adding featured image via PHP
- Store loop into array
- Run The Loop over array of post objects
- Enable infinite scroll on single.php [closed]
- Show Custom Taxonomy Title
- How to loop through ALL pages?
- Does get_template_part pull data once in a loop?
- How to exclude specific category from the get_the_category(); array
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Get titles of all posts with current tags except current post
- How to Display a Single Post Excerpt
- Using get_the_excerpt() Before The Loop
- How to make sure content doesn’t display if selection is empty
- wp_query inside the_loop
- How to go about combining dropdowns / filter queries?
- How to fix pagination for custom loops?
- WordPress Rewriting the DOM?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- Sort results by groups of numbers and letters
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Display post list with different styles
- Loop for sticky posts
- Array ids post to function have_post
- Give each posts in a loop a number in sequence
- custom post on homepage
- I have broke my pagination, same posts on all pages (index.php)
- Trying to change featured image from 180×180 to full width on home page
- Getting selection of posts based on loop variables via Ajax
- Why would this code work locally but break online?
- Why would a completely normal loop give offset errors and maximum execution time errors?
- Avoid WP_Query’s duplicate posts with taxonomies
- Problem in replacing the_content with the_excerpt()
- Loops for cat links not looping for wordpress site
- Need to add a post’s featured image to a section on the frontpage
- Sort posts according to a numeric value entered with ACF
- Display all categories including sub categories under a list ul
- How to get all multi-select user meta values and add them to an array?
- How to resolve a reload loop issue in the frontend when logged in to WordPress multi-site backend admin area
- 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
- Efficient way of querying for a “fallback” post?
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- WordPress loop only displays 5 articles max?
- featured post as div background
- get_template_part() to render single page Theme
- Showing related posts (custom post type) outside of the loop
- Looping taxonomy in taxonomy?
- 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
- How do I filter a custom post type loop by a field?
- Showing ads after posts in home page
- Prevent duplicating specific column from database table