• Resolved texas001

    (@texas001)


    Please can someone help me?

    I have created a blog page and have included the latest 5 posts, however when I click the ‘older entries’ on the bottom of the page to show the previous posts, it loads page2 but still includes the same 5 posts?

    I have read similar problems on this forum but when I try and paste the php codes I get a fatal error, please can someone help me?

    This is the code on my bloghome.php file, do i need to change the code on here or on my archives file?

    [code moderated - please follow http://codex.wordpress.org/Forum_Welcome#Posting_Code when posting code]

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must include the ‘paged’ option in your query_posts().

    <?php
    $paged = (intval(get_query_var('paged'))) : intval(get_query_var('paged')) : 1;
    query_posts("posts_per_page=5&paged=$paged"); ?>
    Thread Starter texas001

    (@texas001)

    Thank you vtxyzzy, so do I put that code in bloghome.php file, and if so where, also do I need to replace it with any other code or just add it?

    Many Thanks

    Thread Starter texas001

    (@texas001)

    I have tried to add that to my bloghome.php file and I’m getting the following error, any ideas what i’m doing wrong?

    Parse error: syntax error, unexpected

    the code by @vtxyzzy is supposed to replace this line:

    <?php query_posts("posts_per_page=5"); ?>
    Thread Starter texas001

    (@texas001)

    Thanks alchymyth, I replaced the line above with the code from vtxyzzy but I’m still getting Parse error: syntax error, unexpected?

    there is possibly a problem with php tags;

    can you paste the full code of your template (as it is now) into a http://pastebin.com/ and post the link to it here?

    Thread Starter texas001

    (@texas001)

    Thanks alchymyth

    http://pastebin.com/5SqmqGNH

    http://pastebin.com/sZLh3yke

    there was a typing mistake in the code by @vtxyzzy;
    should read:

    <?php
    $paged = (intval(get_query_var('paged')) ? intval(get_query_var('paged')) : 1 );
    query_posts("posts_per_page=5&paged=$paged"); ?>

    and this line of your code needed correcting as well (it needs to have straight single quotes instead of the odd ones that you probably got from copy/paste; although it did not create an error):

    <?php remove_filter ('the_content', 'wpautop'); ?>

    Thread Starter texas001

    (@texas001)

    Thank you so much alchymyth, it works perfect! really aprechiate your help!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘"Newer/Older-entries"- displaying same posts’ is closed to new replies.