Page not found half way through pagination
-
I am creating my loops with the following code:
<?php query_posts('cat=164, -13&posts_per_page=6' . '&paged=' . get_query_var('paged')); if ( have_posts() ) : while ( have_posts() ): the_post(); ?>
This works great and I can cycle through pages using pagination too. However for some inexplicable reason the on page 5 of pagination it takes you to an error Page not found page. And on another archive page I have created it goes to page not found on page 6.
If this is of relevance i have used the following code in functions to get rid of the category prefix in my permalinks: `add_filter(‘user_trailingslashit’, ‘remcat_function’);
function remcat_function($link) {
return str_replace(“/category/”, “/”, $link);
}
add_action(‘init’, ‘remcat_flush_rules’);
function remcat_flush_rules() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
add_filter(‘generate_rewrite_rules’, ‘remcat_rewrite’);
function remcat_rewrite($wp_rewrite) {
$new_rules = array(‘(.+)/page/(.+)/?’ => ‘index.php?category_name=’.$wp_rewrite->preg_index(1).’&paged=’.$wp_rewrite->preg_index(2));
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
} `Please help.
- The topic ‘Page not found half way through pagination’ is closed to new replies.