Код: Выделить всё
//custom pagepavi function
function my_pagenavi( $the_query = false ){
global $wp_query;
$query = ($the_query) ? $the_query : $wp_query;
$max = $query->max_num_pages;
$current_page = max(1, get_query_var('paged'));
$big = 999999999;
if ( $max > 1 ) {
echo "";
echo paginate_links(array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => $current_page,
'show_all' => false,
'total' => $max,
'type' => 'list',
'prev_text' => __('PREV','dnp_theme'),
'next_text' => __('NEXT','dnp_theme'),
));
echo "";
}
А вот цикл со страницы моего шаблона.
Код: Выделить всё
//some query stuff
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query = 'offset=0&paged='.$paged;
$blogs = new WP_Query($query);
if ( $blogs->have_posts() ) : ?>
Подробнее здесь: https://stackoverflow.com/questions/166 ... stom-query
Мобильная версия