I am using the following code to generate pagination on my wordpress pages:
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo 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
) );
?>
Notice 'format' => '?paged=%#%'. According to the Codex there'd be a different format for pretty links i.e. codex says
format (string) (optional) Used for Pagination structure. The default value is
'?page=%#%', If using pretty permalinks this would be'/page/%#%', where the'%#%'is replaced by the page number. Default:'?page=%#%'
What I'm getting is, I'd have to change the php code in my theme file whenever I change the permalinks format. That'd be pretty much tedious, so Is there any way that I can make my pagination adapt itself to the permalink style i.e. it doesn't break if I change the permalinks style to pretty?