wp_pagenavi doesn’t work with WP_Query from page2

wp_pagenavi doesn’t work from page 2.

[OK] url/wordpress/2013/06/

Read More

[NG. 404 error occured] url/wordpress/2013/06/page/2/

I tried some plugins, but nothing changed.

This is my code.

$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
    'post_type' => 'post',
    'post_category' => 3,
    'paged' => $paged,
    'posts_per_page' => 9,
    ......
);
$myquery = new WP_Query($args);

<?php if ($myquery->have_posts()) : ?>
            <?php while ($myquery->have_posts()): $myquery->the_post(); ?>

            /* Do stuff */

            <?php endwhile; ?>

wp_pagenavi(array('query' => $myquery));

<?php endif; ?>

Default query works fine in the other page(loop.php).

  • WordPress 3.5.1
  • WP-PageNavi 2.83

Tried plugins are

  • Top Level Categories Fix
  • Custom Post Type Category Pagination Fix

Does anyone know anything?

Related posts

Leave a Reply