I've an issue with the pagination function in WordPress.
Although the anchor text is correct, when I hit the URL for some reasons WP changes it from
www.site.com/page/2 thus generating a 404 error.
My pagination call is like the following:
$paginate_links = paginate_links( array( 'base' => preg_replace('/\?.*/', '/', get_pagenum_link()) . '%_%', 'prev_text' => __('«'), 'next_text' => __('»'), 'mid_size' => 5, 'current' => $current, 'total' => $totalpages ));
The strange thing is that using the same function in an archive page I get this working properly. Any idea on what is wrong?