Forums

[resolved] /page/11/ or above not found, 404 error (4 posts)

  1. liuyiwp
    Member
    Posted 2 years ago #

    Hello, everyone,

    Sorry to start a new thread here. I encountered this weird problem that any page above 10 is not found. I disabled the WP-Pagenavi, no help. I tried default theme, no help. I tried to remove "-189,-190" in my page query code "cat=-189,-190" no help. Can someone please give me a hand? Thank you!

    My WP blog address is http://chinablog.cc

    Here is my page query code

    <?php
          $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
          query_posts("cat=-189,-190&paged=$page&posts_per_page=5"); ?>

    Best,
    Jensen Liu

  2. Samuel B
    moderator
    Posted 2 years ago #

    code looks ok
    try regenerating your permalinks
    admin - settings - permalinks

  3. liuyiwp
    Member
    Posted 2 years ago #

    Thanks for your reply. I tried "save changes" to update my permalinks structure. The problem still exists. It's interesting that page 1-10 works just fine. But not 11 or above...

  4. liuyiwp
    Member
    Posted 2 years ago #

    Just find the reason:

    the error lies in the "posts_per_page=5" parameter. My blog "reading "settings was setting at "6" post per page. Once I change to 5, the problem is gone.

    Now I am wondering how was this query code preserved through entire blog. It seems to me that the code only show up at index page, not in the archvie.php, which is actually generating the "page"s. Is that "$page" a global variant?

    I am pretty new to php, sorry to be no naive...

    Update:
    I just changed blog "reading" "show at most" pages back to 6, no problem happens. Well, maybe it's because of my WP-supercache plugin ... or maybe it's just magic. Whatever, everything works fine now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags