Support » Fixing WordPress » Pagination 404 error on archive,php with query_posts()

  • Resolved krizalis

    (@krizalis)


    Hi guys,

    The problem I’m having: My Pagination Link is displaying correctly.. But when I click on “next” and the link is supposed to bring me to the 2nd page of the pagination on my archive.php template but instead, I got a 404 Page not found error.

    Here’s my custom archive.php template (removed some not important parts of the codes)

    <?php
    global $query_string;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($query_string . '&posts_per_page=4&order=ASC&paged='.$paged); ?>
    <?php if (have_posts()) : wp_pagenavi(); while (have_posts()) : the_post(); ?>
    	//post content related stuff
    <?php endwhile; endif; ?>

    Note:

    • I’m using WP-PageNavi Plugin Version 2.61 to generate my pagination links (and yes they are displaying the correct linking.
    • I’m not using custom permalinks. I’m using the default permalink (aka ugly permalink) and the page 2 of the pagination still isn’t working (the URL looks like this > http://www.domain.com/?cat=3&paged=2)
Viewing 2 replies - 1 through 2 (of 2 total)
  • Anyone has any ideas on how to fix this issue I have? 🙂

    Can a moderator delete 2 of my “bumps” including this one and leave the original so that someone with knowledge on my issue can see the “no replies” and help me? thanks! 😀

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagination 404 error on archive,php with query_posts()’ is closed to new replies.