• 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 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
    					<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', '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.ww.wp.xz.cn/Function_Reference/next_post_link
    http://codex.ww.wp.xz.cn/Function_Reference/previous_post_link

    see the ‘in_same_cat’ parameter

    Thread Starter blong

    (@blong)

    Thank you so much! That document gave me exactly what I was looking for!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding Next/Previous Links’ is closed to new replies.