1

Im trying to increase the numbers/Pages for my pagination. I have 64 pages set, and this is how it shows now: « Previous 1 2 3 4 … 64 Next ». How do I control so I can show more numbers? In my case i need the counter to go up to about 30.

My query:

if ( $pagination === 'numbered' ) {
        global $wp_query;
        $big = 999999999; // need an unlikely integer
        $output .= '<div class="nav-links2">';

        $output .= paginate_links( array(
            'base'      => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
            'format'    => '?paged=%#%',
            'current'   => max( 1, get_query_var('paged') ),
            'total'     => $wp_query->max_num_pages

        ) );
        $output .= '</div>';  
        return $output;

1 Answer 1

1

Refer to the Codex page for paginate_links for all accepted arguments.

The two you want to modify are mid_size and possibly end_size.

$output .= paginate_links( array(
    'base'      => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    'format'    => '?paged=%#%',
    'current'   => max( 1, get_query_var('paged') ),
    'total'     => $wp_query->max_num_pages,
    'mid_size'  => 8 // number of page links to display on either side of current page

) );
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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