How to redirect my custom template page to content-none.php if no posts found?
Farhan, this should do it, add an else to the if statement: $args = [ ‘post_type’ => ‘post’, ‘posts_per_page’ => 1000 ]; $q = new WP_Query($args); if ( $q->have_posts() ) { while ( $q->have_posts() ) { $q->the_post(); ?> <p>The posts styling goes here</p> <?php } // cleanup after the query wp_reset_postdata(); } else { ?> … Read more