批准的答案对我不起作用。采纳某人的建议Edit format of Paginate_Links(), 我使用了以下代码:
PLACE IN FUNCTIONS.PHP
function give_numbers_leading_zero( $number ) {
return sprintf("%02s", $number);
}
PAGINATION CODE
add_filter( \'number_format_i18n\', \'give_numbers_leading_zero\' );
$paginate_links = paginate_links( array(
\'base\' => str_replace( 999999999, \'%#%\', esc_url( get_pagenum_link( 999999999 ) ) ),
\'total\' => $query->max_num_pages,
\'current\' => max( 1, get_query_var( \'paged\' ) ),
\'format\' => \'?paged=%#%\',
\'type\' => \'array\'
) );
remove_filter( \'number_format_i18n\', \'give_numbers_leading_zero\' );
if($paginate_links){
foreach ( $paginate_links as $link ) {
echo $link;
}
}