Using paginate_links() to generate “1, 2, 3 … 10, 20, 30, 40… 55” paginations

The paginate_links() function does this by default. The controlling parameter is mid_size, which determines the number of page links around the current page to display. The default value is 2.

What this means is that, assuming you have 12 pages, and the current page is Page 1, the pagination will look like:

1 2 3 ... 12

But if the current page is Page 6, the pagination will look like:

1 ... 4 5 6 7 8 ... 12

I could be mistaken, but I think that’s how must pagination-link Plugins work.

Edit

Sorry, I misread your question at first, and didn’t grasp that you want to output every tenth page in your pagination links.

This function doesn’t have a built-in parameter to do what you want. Your best bet might be to set 'show_all' to true, change 'type' to 'array', and then construct the output yourself, by looping through the array values.

Leave a Comment