Support » Plugins » Hacks » prev/next navigation for only one category?

  • Resolved bigskydj09

    (@bigskydj09)


    Hi,

    I am using a category template as a way to navigate through photographs. All of the photos show up as single posts with a previous_post_link/next_post_link to navigate throughout (in my left sidebar). However, the navigation links also show up on my blog page. How would I go about making them show up only for navigation through images. My code is as follows:

    <div id=”collab_nav”>
    <?php $previous_post = get_adjacent_post(false, ”, true);
    $next_post = get_adjacent_post(false, ”, false);
    ?>

      <?php if ($previous_post): // if there are older articles ?>
      <li class=”prev”><?php previous_post_link(‘%link’,’Previous’, TRUE); ?>
      <?php endif; ?>
      <?php if ($next_post): // if there are newer articles ?>
      <li class=”next”><?php next_post_link(‘%link’, ‘Next’, TRUE); ?>
      <?php endif; ?>

    </div><!–end div#collab_nav–>`

    Thanks in advance!

  • The topic ‘prev/next navigation for only one category?’ is closed to new replies.