WordPress.org

Support

Support » How-To and Troubleshooting » Older Entries / Newer Entries links not working properly

Older Entries / Newer Entries links not working properly

  • I’ve searched these forums and seen people having this similar problem, but all the solutions I’ve tried don’t work, or seem specific to a customized template the user implemented. So… here’s my version!

    Basically, I’m using code I’ve found on these forums:

    <div class="navigation">
     <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
     <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
    </div>

    And although the older entries link goes to a page 2 URL, it repeats the content on the main page. Any ideas on how to flow in true older entries?

    Below is the code for the entire index.php if needed. Thanks!

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael

    @alchymyth

    Forum Moderator

    does your template have a custom query before the loop?

    but all the solutions I’ve tried don’t work

    which solutions?

    can you post a link to your site?

    Hi alchymyth,
    I had posted the entire code for the index.php but I see it’s been moderated. I just posted something to pastebin, but I have to see how exactly to get you to see it.

    The website is http://georginesaves.com

    Some solutions I tried were (and I’m going on memory here) making posts singular in next_post_link, and having a hard time remembering the others. I’ll see if I can retrace my steps!

    Michael

    @alchymyth

    Forum Moderator

    as for pasting to the pastebin, read: http://codex.wordpress.org/Forum_Welcome#Posting_Code

    your front page template (index.php ?) might have a custom query without the ‘paged’ parameter; http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

    Ah, gotcha… here’s the pastebin link:
    http://pastebin.com/6dubezdF

    I’m looking for something custom, but probably wouldn’t know if it I aw it.

    Was also looking for posts per page as I want to up the amount, but I don’t see that either.

    Thanks!

    Michael

    @alchymyth

    Forum Moderator

    the code is not at all programmed for pagination;

    the way it devides the number of recent posts (from a settings option?) and runs two queries, makes it, at least for me, too complicated to assist with the implementation of the pagination to this theme.
    it would involve nearly totally rewriting the front page template.

    OY!!! Now why the heck would someone program a page like that? Ug. OK… I’ll have to rethink this now.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Older Entries / Newer Entries links not working properly’ is closed to new replies.
Skip to toolbar