How can I prevent posts with no title showing up in my query?
Please find below a quick solution to your problem first query for all empty titles place the result in an array query again for post__not_in see below sample code $query = new WP_Query(‘post_title=\’\”); $a_empty_titles = array(); while($query->have_posts()){ $query->the_post(); array_push( $a_empty_titles ,$query->post->ID); } wp_reset_postdata(); wp_reset_query(); echo count($a_empty_titles); $query = new WP_Query( array( ‘post__not_in’ => $a_empty_titles ) … Read more