• dizzyvapor

    (@dizzyvapor)


    I am using this code on the top of my index page in order to have it display only one post per page:

    <?php get_header();
    query_posts('posts_per_page=1');
    ?>

    My problem is that somehow when using that code, when I click on “Older Entries” I get a 404 Error. Well, first I get a page that looks just like the index but when I click it again, I get the 404. When I take that code out, I don’t get the 404 error but it lists the 10 most recent posts, which I don’t want. Here is the site I’m talking about: https://www.jqpentertainment.com/

    I’d just tell it to list 1 post under the settings in wordpress but I have another page that’s I need to list multiple posts on so that won’t work.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter dizzyvapor

    (@dizzyvapor)

    ..

    tigtog

    (@tigtoggmailcom)

    You should be able to use a conditional php string in your index.php file to make this work that way if you really want to.

    But perhaps what would be simpler would be changing the “Older Entries” link to a “Previous Post” link? And have each single post point to both Previous and Next posts?

    Thread Starter dizzyvapor

    (@dizzyvapor)

    It already does link to the previous post, but it’s broken when I click it.

    Right now I changed it to link the the archives but I’d still like to resolve this.

    go to settings/reading and change the default number “blog pages show at most” from 10 to 5 or 11 or anything else I presume. It worked for me. Don’t know why. For some reason it just doesn’t like the default.

    yes. thanx jimborama. this woked for me too!

    Hi,

    Add this code in htaccess and have a check:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Thanks,

    Shane G.

    Hi, just want to add that I had the exact same problem on littlebobeep.com – and jimborama’s fix worked. Suspicious though, that changing that variable works.

    If anyone has insight about the mechanics behind it i’d be interested

    -paul

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘404 Error when clicking Older Entries’ is closed to new replies.