Support » Themes and Templates » 'in_same_cat'

  • Here is the php previous_post_link, php next_post_link code for twenty ten in single.php template.

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

    How do I make the articles ‘paginate to their category rather than all posts show?

    I have tried putting in ‘in_same_cat’ / $in_same_cat = true in various forms but can’t workout how to get the result I want.

    Bellingen Museum

    Any Ideas, thanks.

Viewing 1 replies (of 1 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    <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', true ); ?></div>
    					<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>', true ); ?></div>
    				</div><!-- #nav-above -->

    ‘in_same_cat’ is the third parameter in the function;
    http://codex.wordpress.org/Function_Reference/next_post_link

    the first is ‘format’ which is '%link'

    the second is ‘link’ which is '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>'

Viewing 1 replies (of 1 total)
  • The topic ‘'in_same_cat'’ is closed to new replies.