WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] prev/next navigation for only one category? (1 post)

  1. bigskydj09
    Member
    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic