Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="list-posts">
- <?php
- query_posts( [
- 'posts_per_page' => 0,
- 'offset' => get_query_var( 'paged' ),
- 'paged' => get_query_var( 'paged' ),
- ] );
- if ( have_posts() ) :
- while ( have_posts() ) : the_post(); ?>
- <div class="post-item<?php echo is_sticky() ? ' sticky' : ''; ?>">
- <div class="thumb">
- <a href="<?php the_permalink(); ?>">
- <?php oe_the_cat_post_thumbnail(); ?>
- </a>
- </div>
- <div class="preview">
- <div class="title">
- <a href="<?php the_permalink(); ?>">
- <?php the_title(); ?>
- </a>
- </div>
- <div class="desc">
- <?php the_excerpt(); ?>
- </div>
- <a href="<?php the_permalink(); ?>" class="read-more">Читать далее</a>
- </div>
- </div>
- <?php endwhile;
- else : ?>
- <p>Статей нет.</p>
- <?php endif; ?>
- </div><!--/.list-posts -->
- <?php
- // удаляет H2 из шаблона пагинации
- add_filter( 'navigation_markup_template', function () {
- ob_start();
- ?>
- <nav class="navigation %1$s" role="navigation">
- <div class="nav-links">%3$s</div>
- </nav>
- <?php
- return ob_get_clean();
- } );
- // выводим пагинацию
- the_posts_pagination();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement