As per Wikipedia, Pagination is the sequence of numbers assigned to pages in a book or periodical.

In WordPress, we generally use WP_Query or query_posts to fetch posts and display the list with pagination. A simple query would look like this:

This will work just fine in most of the cases but sometimes we hear issues that the pagination is not working properly or pagination numbers are correct but every page shows the same list. It’s mostly because we haven’t included the ‘paged‘ parameter to the query. The following is taken from WordPress Codex.

you add the parameter like this:

The next example is exactly the same as above but with the parameters in an array:

Detailed information about how to properly configure and work with WordPress Pagination can be found in the WordPress Codex.

Published by karunshakya

Been programming in PHP / WordPress for over 4 years. I specialize in theme with Multilingual feature and plugin development and manipulation.