Answer the question
In order to leave comments, you need to log in
Why is pagination not working on the archives page in Wordpress?
I tried many ways to fix this problem, nothing helped. I use a custom URL: /%category%/%postname%
There is a pagination code:
function wp_corenavi() {
global $wp_query;
$pages = '';
$max = $wp_query->max_num_pages;
if (!$current = get_query_var('paged')) $current = 1;
$a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));
$a['total'] = $max;
$a['current'] = $current;
$total = 0;
$a['mid_size'] = 3;
$a['end_size'] = 2;
$a['prev_text'] = '«';
$a['next_text'] = '»';
if ($max > 1) echo '<div class="navigation">';
if ($total == 1 && $max > 1) $pages = '<span class="pages">Страница ' . $current . ' из ' . $max . '</span>'."\r\n";
echo $pages . paginate_links($a);
if ($max > 1) echo '</div>';
}
//end
<?php if( have_posts() ){ while( have_posts() ){ the_post(); ?>
Answer the question
In order to leave comments, you need to log in
I can't understand why you even expect a url without a category base to work? That is, www.site.ru/knigi/page/2 and should not work, at the same time, www.site.ru /category/ knigi/page/2 should work, because it has a category base (highlighted in bold ). In general, everything is OK, as it should be. For some reason you are just waiting for atypical behavior where it should not be. This time.
Two - enough already to invent some crutches for pagination. There are built-in tools for every taste.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question