Page navigation
-
Hi all!
It is impossible to connect the class “pagination blog-pagination” for function<?php advanced_page_navigation($args); ?>
Write:<ul class="pagination blog-pagination"> <?php advanced_page_navigation($args);?> </ul>Functions.php
function advanced_page_navigation($args = false) { global $wp_rewrite, $wp_query; if ($wp_query->max_num_pages == 1 || $wp_query->max_num_pages == 0) return; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $default_args = array( 'base' => @add_query_arg('page','%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => false, 'max_size' => 10, 'mid_size' => 1, 'end_size' => 1, 'type' => 'ul', 'prev_text' => '<li>'.'<aria-label="Previous">'.'<span aria-hidden="true">'.'«'.'</span>'.'</li>', 'next_text' => '>', 'echo' => false ); $args = wp_parse_args($args, $default_args); if ( $args['max_size'] >= $wp_query->max_num_pages ) $args['show_all'] = true; else $args['show_all'] = false; if( $wp_rewrite->using_permalinks() ) $args['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged'); if( !empty($wp_query->query_vars['s']) ) $args['add_args'] = array('s'=>get_query_var('s')); $args['echo'] = false; // На всякий случай echo "<ul class=\"pagination blog-pagination\">Страница $current из {$wp_query->max_num_pages} " . paginate_links($args) .'</ul>'.PHP_EOL; }Help please.
As it should be that at this point:

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Page navigation’ is closed to new replies.