WP page navi. 404 error
-
Hi all,
I’m trying to fix an error with pagination of WP page Navi plugin. After I’ve added posts_per_page parameter to the query I’m getting 404 error when clicking on link page3,4 etc (there are 10 records totally) and after page 8 (where there around 60 records totally). Without this parameter it works fine but I want to display various number of posts under categories.
Here is the code of one of the pages I’m trying to fix:
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
query_posts($query_string .’&posts_per_page=5&paged=’ . $paged);
?><?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>- “><?php the_title(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?><?php endif; ?>
<?php if (function_exists(‘wp_pagenavi’)){ wp_pagenavi(); } ?>
Any help is much appreciated.
- The topic ‘WP page navi. 404 error’ is closed to new replies.