WordPress.org

Ready to get started?Download WordPress

Forums

Older Entries / Newer Entries links not working properly (7 posts)

  1. ghansen
    Member
    Posted 2 years ago #

    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]

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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?

  3. ghansen
    Member
    Posted 2 years ago #

    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!

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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

  5. ghansen
    Member
    Posted 2 years ago #

    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!

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  7. ghansen
    Member
    Posted 2 years ago #

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

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic