Do you want to add Pagination in your WordPress Blog page or Archive Page or the page where a large number of posts listed? Then this is the best guide for you.
When we build WordPress themes for blog page or archive page, We need to add numeric pagination for the users to tell them there are more posts that you would love to see on next page or on page number 2,3,4….120 etc. For adding that we need to use custom functions.
Read Also: How to add Next and Previous post Button in Genesis Theme?
Here we have posted the simple 2 code snippets that easy to use and customizable which you can use in your WordPress website to display pagination. Just follow the below guide.
Let’s not waste time and get to the point.
Add Numeric Pagination in WordPress
Below we have embedded 2 code snippets for adding pagination in WordPress Theme, Just use one of them as per your need and flexibility of customization.
Let’s explain both codes in details.
Simple Pagination Code for WordPress Posts
The code which is just below would help you to add the numeric pagination in WordPress posts. This is the simple code that will add previous, next and page 1, 2, 3, 4, ……last number page button.
How to use this code?
Just copy the below code and paste it into your theme’s archive, search, or blog posts page at the end of your posts query. For example, We have the blog page where we have a large number of posts and here we want to display pagination. So what we would do is go to the home.php page (which is the page that used in a blog) and after the endwhile; or if you have endif;, We will paste the code.
Simple Pagination Code
Advanced Pagination Code for WordPress Posts
The last code which is embedded below is the best if you want to customize the div, text of pagination and many more things.
How to use this code?
Just copy the below code into your WordPress Theme’s functions.php file. After that customize the things that you want and save. Now place the numeric_pagination(); to where you want to display pagination in WordPress posts or archive page.
Advanced Pagination Code
That’s it.
If you guys have any questions or opinion about this post, Please let us know in comment section. Also, do share this article on social media websites.
Happy Coding! 😉