When I exclude categories in my query the page navigation links to 3 extra blank pages. Page one shows all 3 of the posts that should show but then there are links to 3 blank pages.
My query looks like this:
<?php /* Start the Loop */ $my_query = new WP_Query( array( 'cat' => '-5,-20,-21,-22,-23,-24,-25,-26,-27', 'posts_per_page' => '3', 'paged' => get_query_var('paged'), 'orderby' => 'date')); while ( $my_query->have_posts() ) : $my_query->the_post(); ?> ****** Code to print out posts goes here ****** <?php endwhile; /* End the Loop */ ?> <?php wp_pagenavi(); ?> <?php wp_reset_query(); ?>
Any idea what I am doing wrong and how I can fix it?
- The topic ‘Extra blank pages when query excludes categories’ is closed to new replies.