change previous and next post names on single.php (2 posts)

  1. iwoolmantoo
    Posted 8 years ago #

    Thanks for taking a look here. What I'd like to do is get my single page previous and next to not show the name of the post, but to simply say "before" and "after." I've had no luck with several suggestions I found in this forum on a search, so I'm hoping someone has a solution. Here's what the code says now:

    <?php previous_post_link('« %link «') ?>
    <?php next_post_link('» %link »') ?>

    I've tried replacing the "%link" with, for instance, "before," and I get the word, but it's no longer a link. Any ideas on how I can get the word as a link would be much appreciated.

    Thanks again for taking the time.


    EDIT: P.S. The arrows above in the actual code are "laquo" with an & before it and "raquo" with an & before it. Posting it here turned them into their respective arrow symbols.

  2. Corrina007
    Posted 8 years ago #

    Try editing your template's index.php file. Look for these tags:

    `<?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Previous Post') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Post »') ?></div>

    And write whatever you want them to read on your page. Worked for me.

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Topic