WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to extend the wp_link_page function to only show a max of 5 links at a time. What is the best approach to limit the number of links?

In the end i'd like it to look like this: Previous 1 2 3 4 5 ... Next

I've already used this solution to generate the prev/next buttons along side the numbers.

share|improve this question
You're talking about pagination and not about wp_link_pages(). Please do some research before posting. – kaiser Sep 25 '12 at 22:44
No no no my friend i'm talking about interior post pages using <!--nextpage--> and in that case yes you would use wp_link_pages. – HjalmarCarlson Sep 25 '12 at 23:22

The pagination plugin "pagebar" does contains this functionality. You can find it in the repository.

share|improve this answer
At least a link, and even better: an explanation how it works would be useful. – toscho Oct 4 '12 at 21:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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