how to edit this condition in order to count only the posts with thumbnails?
if ( $my_query->have_posts() && ( ( $my_query->post_count ) >= 3 ) )
how to edit this condition in order to count only the posts with thumbnails?
if ( $my_query->have_posts() && ( ( $my_query->post_count ) >= 3 ) )
You must be logged in to post a comment.
You have to check it in a different way;
You must do the loop, because thumbnail relationships are not resolved automatically:
I’m not sure if this still works, but from this thread you can select posts with a thumbnail by specifying
meta_key=_thumbnail_id
in your original query.