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

Below is my pagination code. It can be seen in action at this link. When I start on page one it displays the first 3 pages and page 9 (the last page). When I go to the second it displays the first 4 and page 9. I find this to be odd behavior and expect the numbers to be added in a traditional behavior, like that code found on CSS tricks. Does anybody know what I've done incorrectly in my code below?

 // the block for pagination
        global $wp_query;
        $big = 999999999; // need an unlikely integer
        echo paginate_links(
                'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
                'format' => '?paged=%#%',
                'current' => max( 1, get_query_var('paged') ), 
                'total' => $wp_query->max_num_pages
share|improve this question
Did you get this from a specific article, if so can you please name it and link to it? – Joe Izzard Dec 24 '12 at 23:29
up vote 1 down vote accepted

What you are seeing, I believe, is a result of paginate_links using three blocks of numbering-- first, middle, and last. If you had enough pages you'd get, for example, when browsing page 50 ...

1 2 3 ... 49 50 51 ... 98 99 100

If you imagine the "middle" numbers overlapping the "first" numbers you'd get 3 or 4 or five numbers bunched up. You can play with the end_size and mid_size parameters and try to get something you like better, or use 'type' => 'array' and write your own display function to convert the resulting array into actual pagination links.

share|improve this answer

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.