将代码直接应用在页面模板中
global $wp_query;
$max = 999999999;
echo paginate_links(
array(
'base' => str_replace( $max, '%#%', esc_url( get_pagenum_link( $max ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged')),
'total' => $wp_query->max_num_pages,
'prev_text' => 'Previous',
'next_text' => 'Next'
)
);
https://developer.wordpress.org/reference/functions/paginate_links/