So I’m using pagenavi on my site and it works correctly on every page but one. The same query is used for the pages except the queries call different post types. The issue I’m having is that on the News page when you click Page 2 or the next page button it goes to the home page. I’m not sure why it’s doing this but any help would be appreciated. The following is the code that I’m using.
<?php $args = array('post_type'=>'news', 'posts_per_page' => 10, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),); query_posts($args); while (have_posts()) : the_post(); ?> <div> <?php the_excerpt(); ?> </div> <?php endwhile; ?> <div id="pagenavi-wrap"> <?php wp_pagenavi(); ?> </div>
Thanks in advance.
- The topic ‘Pagenavi: Page2 or next page goes to home page’ is closed to new replies.