I am using the built in paginate_links function and setting format
parameter 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
) );
}