How to add pagination in WordPress Print

  • 0

Pagination splits long lists of posts across several pages.

Set posts per page

Go to Settings › Reading and change Blog pages show at most to the number of posts per page. Most themes then show page links automatically.

Add pagination in a theme

If your theme doesn't show page links, add this after the post loop in templates such as index.php or archive.php (preferably in a child theme):

<?php the_posts_pagination( array(
    'mid_size'  => 2,
    'prev_text' => __( '« Previous' ),
    'next_text' => __( 'Next »' ),
) ); ?>

Block themes

In the Site Editor, add the Pagination block inside a Query Loop block.

Split a long post

In the block editor, insert a Page Break block where you want each page to end.


Was this answer helpful?

« Back