WordPress.org

Forums

WP-PageNavi
Pagenavi: Page2 or next page goes to home page (2 posts)

  1. Dying2Live
    Member
    Posted 2 years ago #

    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.

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

  2. spello
    Member
    Posted 2 years ago #

    Probably article name is the same as category prefix name.

    Try to change name of that page(article).

    For example, if your category prefix is "books" and your browse article is named "books", then pagination won't be working.
    ("books/page/2" --> WP will think that category is titled "page" and subcategory is "2")

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic