Does your blog show page numbers at the bottom? If not, readers hit a dead end after your latest posts. When you add pagination in WordPress, readers get a clear path into your archive. Moreover, search engines reach your older articles more easily.

Back in 2011, I added pagination to Thesis with the WP-PageNavi plugin and a custom hook. Today, WordPress handles it without any code. In this guide, we will set it up in a block theme and then add previous and next links to single posts.

How to Add Pagination in WordPress Block Themes

Block themes, such as Twenty Twenty-Five, build every page from blocks. Therefore, pagination is simply another block you can place and style.

Step 1: Open the Blog Template

Go to Appearance > Editor > Templates and open the template that lists your posts, usually Blog Home or Index.

Step 2: Select the Query Loop Block

Open the List View from the top toolbar and select the Query Loop block, which holds your posts. Many themes already include a Pagination block inside it, below the Post Template.

Step 3: Insert the Pagination Block

If pagination is missing, select the Query Loop, click the plus icon, and insert the Pagination block. By default, it shows Previous, page numbers and Next. Additionally, the block settings let you pick an arrow style or hide the numbers.

Step 4: Set Posts per Page

Go to Settings > Reading and adjust “Blog pages show at most”. Alternatively, give the Query Loop a custom query and set the number there. Finally, save the template and check your blog page.

Add Previous and Next Links to Single Posts

Pagination helps on archive pages. However, most search visitors land on a single post, and many leave when nothing follows the article. For that reason, I styled bold previous and next links on this blog in 2011.

Today, you can build the same navigation without writing code:

  • Open Appearance > Editor > Templates > Single Posts.
  • Add a Row block below the Post Content.
  • Inside it, insert the Previous Post and Next Post blocks.
  • Turn on the option to display the post title as the link.
  • Optionally, limit the links to posts in the same category.

For style, select the Row, open the Styles panel, and add a top border, extra padding and a larger font size. Consequently, the links stand out, just like my old green arrows did.

Using a Classic Theme?

Classic themes still work, but they need a few lines of PHP. First, create a child theme, so updates do not wipe your changes. Add this to the template that lists posts, such as index.php or archive.php:

<?php the_posts_pagination( array( 'mid_size' => 2 ) ); ?>

Similarly, add this to single.php for previous and next links within the same category:

<?php the_post_navigation( array( 'in_same_term' => true ) ); ?>

Always back up your theme files and test on a staging copy before editing live templates. The WP-PageNavi plugin still exists, although most sites no longer need it.

Quick Checklist

  • A Pagination block inside the Query Loop on your blog template.
  • A sensible posts-per-page number in Settings > Reading.
  • Previous and next links on single posts, with titles visible.
  • A mobile check, since numbered links can wrap on small screens.

Small navigation details keep readers moving through your content. As a result, they read more and bounce less. If you would like help with your WordPress website, talk to our team in NOIDA.