I would like to add next and previous links at the top of my post that stay within a certain category. I am using the theme twenty ten. What is the best way to do this? Thanks :)
I would like to add next and previous links at the top of my post that stay within a certain category. I am using the theme twenty ten. What is the best way to do this? Thanks :)
edit single.php - the link tags are there already:
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
</div><!-- #nav-above -->
(and same thing further down: <div id="nav-below" class="navigation">)
then use the info from the docu:
http://codex.wordpress.org/Function_Reference/next_post_link
http://codex.wordpress.org/Function_Reference/previous_post_link
see the 'in_same_cat' parameter
Thank you so much! That document gave me exactly what I was looking for!
This topic has been closed to new replies.