So my blog index page which displays all blog posts with pagination is at /my-blog/
Page two is at /my-blog/2
When I'm on any page but the first (or if i use /1 for the first page) paginate_links() is able to correctly add the right class to the current page's link to indicate we are on that page. However, when I am on the first page with the url being /my-blog/ it fails to do this correctly because the 'base' and 'format' settings are looking for '/my-blog/%_%' and '/my-blog/%#%'respectively.
I am not using a loop, instead using get_posts. How can I get the pagination to correctly indicate that the user is on the first page when the path does not include a number (/my-blog/)?
$paged = get_query_var('page'); $args = array('paged' => $paged); $wp_query = new WP_Query($args); echo paginate_links( array( 'base' => '/my-blog/%_%', 'format' => '/my-blog/%#%', 'current' => max( 0, get_query_var('page') ), 'total' => $wp_query->max_num_pages, 'end_size' => 8, 'mid_size' => 2));