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 add condition in wordpress loop? [closed]
- How to inject posts from certain category on home page
- Woocommerce : Can’t get product info in loop
- Trouble Formatting DateTime
- Display custom post type title as text if post thumbnail is not available
- Order archive results by post id in custom taxonomy template
- Using an ACF field from a page within a post loop?
- Duplicate posts in paginated results
- Publish Categories for a particular Author on a given Post
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Detect if current page is front page within custom query
- Output loop leveraged shortcode twice on one page
- The Loop – mixed ASC and DESC order
- Filter the_posts doesn’t work on search page
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- Pagination for multiple loops
- Counter in loop in foreach
- Alert Bar section within WP loop is displaying even though there are no posts
- remove post that has no content
- Display Authors in a grid loop
- trouble calling an import class from an action in a plugin before wp_cron executes
- How to fix pagination for custom loops?
- Display category name only once inside loop
- Infinite Scroll and DFP
- Two loops on different pages do the same thing, but only one page works
- Posts active and expired in different loops
- angularjs not displaying all posts
- Blog page Server error 500 with stick post loop in query.php
- Can’t find infinite loop cause
- Blog’s post count cause irratic behavior
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- pre_get_posts for two loops on same page
- Ajax Button to load more Posts into a timeline
- Sanitize Custom Field Value in Meta Query
- Default ‘post’ post type archive slug?
- Stuck in the query loop
- How to target thumbnails of the first post in the loop
- show random image in loop if image is not set
- How do I style the first two posts of a loop
- Get Page content to displayin Bootstrap Modal
- WordPress Rewriting the DOM?
- How can I paginate this?
- Obtain page data and use regular loop
- How to display posts by vote count and if no value continue with latest posts with no votes?
- How can I load posts starting from, and including, the current post?
- Load wordpress content in other domain
- Genesis multiple category custom loop 404s after first page
- Custom Loop Using Shortcode in Custom Page Template
- Do I need to use The Loop on pages?
- Sort results by groups of numbers and letters
- Listing subpages title and content and styling the first iteration differently
- Infinite Scroll on a loop?
- Shortcode in posts called by ajax is not working
- 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
- How to fix pagination for custom loops?