• Hello,

    I am using the Skirmish theme. When viewing single posts, underneath the content are links to previous and next posts. These are simply hyperlinks left and right aligned. You can see an example below the content at this link. I would like to add the text “Previous Post:” and “Next Post:” to precede the post title links. I am unsure of how to do this. The code in my template-tags.php is the following:

    <?php if ( is_single() ) : // navigation links for single posts ?>
    
    		<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '', 'Previous post link', 'skirmish' ) . '</span> %title' ); ?>
    		<?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '', 'Next post link', 'skirmish' ) . '</span>' ); ?>

    Can anyone share with me how I could add the Previous Post:/Next Post: text before the actual link?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Try that… This will add ‘?? Previous Post’ and ‘Next Post ??’ above the both links.
    Demo for your blog here : https://www.monsterup.com/upload/1355478461814.png

    Just before %link, add :
    &laquo;&laquo; Previous Post<br />
    for previous_post_link

    and Just before %link, add :
    Next Post &raquo;&raquo;<br />
    for next_post_link

    Like this (copy/paste this to overwrite) :

    <?php if ( is_single() ) : // navigation links for single posts ?>
    
    		<?php previous_post_link( '<div class="nav-previous">&laquo;&laquo; Previous Post <br />%link</div>', '<span class="meta-nav">' . _x( '', 'Previous post link', 'skirmish' ) . '</span> %title' ); ?>
    		<?php next_post_link( '<div class="nav-next">Next Post &raquo;&raquo;<br />%link</div>', '%title <span class="meta-nav">' . _x( '', 'Next post link', 'skirmish' ) . '</span>' ); ?>

    Thread Starter gamebynight1

    (@gamebynight1)

    Thank you, Riversatile. That accomplished exactly what I was looking for ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Label "previous" and "next" post links?’ is closed to new replies.