The default setup for paginate_links is very odd to me. For example if I'm on page 5 of a total of 9 pages, this is how it will display:

<prev 1 ... 3 4 [5] 6 7 ... 9 next>

What I want to achieve is to display it something like Google search results page where I only show the current 5 (Google does 10) pages. I don't see any dots and I don't see the last page or the first pages unless I'm within that 5 page range. I want the user to click next as many times as needed to reach the end. So in other words the user doesn't know the total number of pages. Something like this:

On the first page:

[1] 2 3 4 5 next >

One the fifth page:

<prev 3 4 [5] 6 7 next>

Is this possible?


I'm not going to copy and paste someone else's code and explain how to.. just a 5 minute search on google "customize pagination WordPress demo" result: Great tutorial of how to set pagination I think this is exactly what your looking for.

  • This is great, thank you! For some reason I was stuck searching for ways to customize the paginate_links function and hitting a dead end without realizing you can build something simple with get_pagenum_link. – user3376065 Sep 14 '16 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.