Pagination using paginate_links

Question

I am using the built in paginate_links function and setting formatparameter to the default value:
'?paged=%#%' . For some reason, it keeps redirecting to a different formatted url. For example, when I click the paginated link to page two it should be www.domain.com/subpage/?paged=2, but instead it’s formatted as www.domain.com/subpage/page/2 . Not sure how to stop this redirect? Any ideas?

Here’s the function with the parameters I’m using:

function custom_page_navi( $totalpages, $page, $end_size, $mid_size )
{
    $bignum = 999999999;

    if ( $totalpages <= 1 || $page > $totalpages ) return;

        //NOTE: https://codex.wordpress.org/Function_Reference/paginate_links
    return paginate_links( array(
        'format'        => '?paged=%#%',
        'current'       => max( 1, $page ),
        'total'         => $totalpages,
        'prev_next'     => false,
        'type'          => 'list',
        'show_all'      => false,
        'end_size'      => $end_size,
        'mid_size'      => $mid_size
    ) );
}
0
, , bhood 6 years 2017-07-24T13:17:37-05:00 0 Answers 97 views 0

Leave an answer

Browse
Browse