WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding link to older posts (6 posts)

  1. slgolden
    Member
    Posted 5 years ago #

    I searched the forum on this topic and was directed to the page explaining the next post/previous post links, but I can't understand it. It's marked as in need of editing, and that's really true.

    I understand that I need to edit the index.php file of my theme, but I don't know where to insert the links in that file.

    Do I just add
    <?php previous_post('« « %', '', 'yes'); ?>
    | <?php next_post('% » » ', '', 'yes'); ?>

    and where do I add it?

    Thank you for any help

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Do I just add [...]

    Yes - although now that you have read the Codex page on these template tags, you'll be able to edit the parameters according to your needs.

    where do I add it?

    Right at the end of the Loop. After the <?php endwhile; ?> and before the <?php endif; ?>.

  3. slgolden
    Member
    Posted 5 years ago #

    Thank you so much! I managed to do it, although I found the code only worked when I put it after the <?php endif; ?>.

  4. philtyler
    Member
    Posted 4 years ago #

    It's still not working for me. All I see is the "|"
    I tried it before and after the '<?php endif; ?>'

  5. philtyler
    Member
    Posted 4 years ago #

    Code is working, but is totally in the wrong place. Check it out at
    http://www.philtyler.info
    scroll all the way down, how do I get them centered? Is there a way to switch the little arrows?
    Thanks!

    oh here's the code:
    '<?php endwhile; ?>

    <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>
    <?php previous_posts_link('Newer Entries »') ?> <?php next_posts_link('« Older Entries') ?>
    </div>'

  6. philtyler
    Member
    Posted 4 years ago #

    I got it with a simple '<p align="center">'
    ..next is getting the arrows correct..

Topic Closed

This topic has been closed to new replies.

About this Topic