|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php if( isset( $_REQUEST[ 'page_number' ] ) ){ $current_page = $_REQUEST[ 'page_number' ]; } else{ $current_page = 1; } $args = array( 'category_name' => 'festivals', 'post_type' => 'post', 'posts_per_page' => '2', 'orderby' => 'date', 'paged' => $current_page ); $query = new WP_Query( $args ); while ( $query->have_posts() ) { $query->the_post(); the_title( '<h3>', '</h3>' ); } $args = array( 'total' => $query->max_num_pages, 'current' => $current_page, 'format' => '?page_number=%#%' ); global $wp_query; $wp_query->max_num_pages = $query->max_num_pages; the_posts_pagination( $args ); ?> |
https://ru.wordpress.org/support/topic/не-выводится-пагинация/