WordPress has various plugins available in its directory. Each one of them is used for executing a different task. Some of the users who are WordPress beginners find these plugins useful to make their life easier. But, many users or developers don’t want to add extra plugins for each function and hence take help of coding in that case. If you are one of those, who want to add ‘post pagination feature’ without a plugin then stay right here. In this tutorial, we will let you know how to add WordPress post pagination without plugins.
Before that, you should know the benefits of splitting posts. There are a number of benefits to splitting posts, such as:
- Post pagination feature improve the look and feel of your site if you regularly publish long-form articles, tutorials and guides
- You get more page space to place your ads, thus increasing your advertising revenue
- You increase the number of page views for your website
- At last, post pagination helps decrease the bounce rate on your site by encouraging readers to spend time reading through your content
Here are a few methods which will help you to build WordPress post pagination without plugins.
- Adding WordPress post pagination
Most of the themes today support pagination features and it could be easily done through <!––nextpage––> tag. All you need to do is copy the tag and paste in the post wherever you want to add the page split feature. Also, there is a combination of keys (Shift+Alt+P) that you can use instead of writing this tag.
Note: make sure that you are using the Text view rather than Visual view in your post editor.
Sometimes pagination is successful, but the navigation section does not appear. If the pagination is not showing up after you have pasted the next page tags, it is because your present theme is unable to handle the tag for splitting the page. In that case, you would need to add the following code in your single.php loop.
<?php wp_link_pages(); ?>
Once you have added the above-mentioned code, then the pagination will start to show. There are several parameters for this function that you can use as well. You can check the codex page for Styling Page-Links.
If you don’t want to mess with coding then you can use WordPress pagination plugins as well.
We believe this tutorial has helped you to add post pagination in WordPress easily. If you liked our article, please do share this over social media and spread the word. This will help us to reach more users like you.