The Next Post and Previous Post blocks allow you to customize how your post navigation looks beyond the default WordPress blocks.
The Next Post block will show the next chronological post so that a reader can read another post. The Previous Post block will show the previous chronological post.
And you’ll be able to customize how those posts will look, just like you can inside a query block.
- All of the attributes for this block found in the code is simply so that the inner post template blocks have something to use to show the user so they can craft the block they want it to look.
How to use this block
Using the post navigation blocks is pretty simple. It’s best if you add them to the single post template. You simply add them to the template and then you can add in post template blocks, like the featured image, post title, post excerpt and more, just like you can with the query loop.
It’s highly recommended that you put them inside a columns block or a basic grid block (with two columns) so that they’re side-by-side. You can also use the post navigation block pattern to get started quickly.