Support » Themes and Templates » Post navigation Twenty Ten Child theme

  • I have a question regarding post navigation. I have made a child theme of Twenty Ten and i wish for my post navigation only to show the posts from the category from which my visitors enter.

    At the moment alle posts are being showed with next and previous links.

    I can see that in earlier versions you could write something like

    <?php next_post_link('format','link','in_same_cat','excluded_categories'); ?>

    But this dosnt seems to work any more in wordpress 3.0.4
    How do i change the following code so that my visitors only can go through the posts from the category in which they enter?

    <?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'campell' ) . '</span> %title' ); ?>
    
    <?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'campell' ) . '</span>' ); ?>

    Help please 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    http://codex.wordpress.org/Function_Reference/next_post_link

    the third parameter is the ‘in_same_cat’; the current links only use two parameter, so the true to keep them in the same cat comes after the existing parameter;

    try:

    <?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'campell' ) . '</span> %title', true ); ?>
    
    <?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'campell' ) . '</span>', true ); ?>

    i will defintily try that and let know if it works 🙂
    Thank you for your answer

    it works like a charm 🙂
    thank you for your help

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post navigation Twenty Ten Child theme’ is closed to new replies.