Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to switch from the Next Post/Previous Post type navigation, to showing the title of the previous or the next post.Here is the code I think needs to be changed, it's form loop-single.php

<nav id="nav-single">
    <h3 class="assistive-text"><?php _e( 'Post navigation', 'admired' ); ?></h3>
    <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'admired' ) ); ?></span>
    <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">&rarr;</span>', 'admired' ) ); ?></span>
</nav><!-- #nav-single -->
share|improve this question

2 Answers 2

Thats WordPress default usage.. Just remove the content within the brackets:

<nav id="nav-single">
    <h3 class="assistive-text"><?php _e( 'Post navigation', 'admired' ); ?></h3>
    <span class="nav-previous"><?php previous_post_link(); ?></span>
    <span class="nav-next"><?php next_post_link(); ?></span>
</nav><!-- #nav-single -->
share|improve this answer
<nav id="nav-single">
    <h3 class="assistive-text"><?php _e( 'Post navigation', 'admired' ); ?></h3>
    <span class="nav-previous"><?php previous_post_link( '%link' ); ?></span>
    <span class="nav-next"><?php next_post_link( '%link' ); ?></span>
</nav><!-- #nav-single -->

That should work. next/previous post link functions have defaults for all their arguments, and the second one will default to '%title', which will be replaced with the post's post_title property.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.