Hide elements outside loop based on query
You can use the function wp_list_pluck to get the ID of the posts retrieved from the query. Just move the query before the h2 element and get the posts ID’s: // Set a bool to know if at least one post has post thumbnail. $has_thumb = false; $first_query = new WP_Query(‘cat=1&author=” . $post->post_author . “&order=DESC&tag=Tattoo&posts_per_page=1000’); … Read more