WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Extra blank pages when query excludes categories (1 post)

  1. mccawphoto
    Member
    Posted 9 months ago #

    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?

    Thanks!

    http://wordpress.org/plugins/wp-pagenavi/

Reply

You must log in to post.

About this Plugin

About this Topic