Search for Resources and Solutions

the_pagination - create a pagination as you need

I have created many years ago a pagination in PHP with same concept even in JS. The pagination is used in all my scripts because it's simple and easy to use. My pagination displays maximum 5 numbers, next and previous links. 

In the Midrub Frontend's Themes i'm using the function get_pagination to display the pagination with 5 numbers, previous and next links.

If you don't like my pagination, you are free to create yours. For this you can use the function the_pagination which returns the information to create a pagination.

The the_pagination  function returns:

  • total - total number of contents.
  • current - current page.
  • limit - the displaying limit. 

You can use these parameters to create your own pagination. 

It's important to know, the function the_pagination works only if before was called the function the_contents_list_by_the_classification

Was this article helpful?