Не выводится пагинация постов
Прошу помочь разобраться с пагинацией.
Код:
<?php $posts = get_posts( array( 'numberposts' => 3, 'post_type' => 'post', 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса ) ); foreach( $posts as $post ){ setup_postdata($post); // формат вывода the_title() ...?> <!-- Entry --> <article class="row entry"> <div class="entry-header"> <div class="permalink"> <a href="<?php the_permalink() ?>"><i class="fa fa-link"></i></a> </div> <div class="ten columns entry-title pull-right"> <h3><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3> </div> <div class="two columns post-meta end"> <p> <time datetime="2014-01-31" class="post-date" pubdate=""><?php the_time('F jS, Y') ?></time> <span class="dauthor"><?php echo get_the_author(); ?></span> </p> </div> </div> <div class="ten columns offset-2 post-content"> <?php the_excerpt(); ?> </div> </article> <!-- Entry End --> <?php } the_posts_pagination(); wp_reset_postdata(); // сброс ?>
В данном случае пагинация не выводится.
Буду благодарен за совет.
Попробуй добавить может
'nopaging' => false
хотя параметр и так по умолчанию идет. А так лучше всего юзать WP_Query, в дефолтной реализации пагинации ни разу с пагинацией проблем не было. Либо попробуйget_the_post_pagination()
или вот это статьюhttps://wp-kama.ru/function/paginate_links
Именно она мне помогла в свое время.