0
votes

I'm having an issue with Wordpress Pagination giving me a 404 error when I set the default posts page to be "blog". I've changed it to other pages and it seems to work fine but just the /blog/page/2 returns me a 404 error.

Here is my pagination method

function my_pagination()
{
    global $wp_query;
    $big = 999999999;
    echo paginate_links(array(
        'base' => str_replace($big, '%#%', get_pagenum_link($big)),
        'format' => '?paged=%#%',
        'current' => max(1, get_query_var('paged')),
        'total' => $wp_query->max_num_pages
    ));
}

I've searched google and loads of other people seem to be having similar problems but they are using custom post types, I'm using the default Wordpress posts functionality.

If anybody has had this issue before or knows how to fix it then I would appreciate any help. Thanks.

1

1 Answers

0
votes

Ok I figured this out - the reason it was happening is because some other idiot who was working on the project decided that he would add rewrite rules for the blog url (/blog/).

Note to self/everyone remember to check if there have been any rewrites put in place for the url.