Support » Plugin: WP-Paginate » [Plugin: WP-Paginate] Archive Pagination redirects to home page?

  • I’m using the wp-paginate plugin to paginate certain sections of the site I’m currently working on and it’s working fine for everything but the Archive page.

    The first page of the Archive (archive.php in my theme) shows up just fine. But when you click on a page number or the next button, you are taken to the home page(index.php).

    Here’s the code for my query:


    About the variables: I’ve made a function that forms the query.

    Anyway, I’ve tried this on both my localhost, and a live server and the behaviour is the same (I thought maybe my .htaccess was at fault locally). The URL for archive pages is but it uses the index template not the archive.

    Any ideas why this could be? Maybe it’s another plugin interfering?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Eric Martin


    You are missing the paged parameter in your query_posts() function. The following post should answer your question:

    Unless I’m missing something I don’t believe I am.

    Here’s the code again, this time showing the variable being set.

    $thepage = (get_query_var('paged')) ? get_query_var('paged') : 1;


    The exact same code is working for paginating my search results, but in the archive the page links (1,2,3 etc.) come up, but take you back to the home page.

    Thanks for your quick reply by the way!

    Update: Clicking on the archive page links actually results in a 404 “page not found”.

    Plugin Author Eric Martin


    Ahh, sorry, I didn’t see the paged parameter.

    Check your Archive page links with the plugin and without and see if there is a difference.

    They’re exactly the same, and also producing a 404.

    Oh, and I’ve tried changing Permalink structure, but still get the same thing.

    Plugin Author Eric Martin


    Can you show an example of the link?

    The link for my localhost is:


    Any suggestions for something to look into as a solution?

    This is happening on another site I’ve worked on as well, only on it there are some sections of the archive that paginate perfectly.

    I’ve solved the issue. Here’s what fixed things for me:

    Changed reading settings for “Blog pages show at most” from 10 to 5.

    That solved the 404, but then my query wasn’t working properly so I changed it to look like the follow:

    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;

    Hope this helps anyone else looking to paginate their archive!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WP-Paginate] Archive Pagination redirects to home page?’ is closed to new replies.