• I have been trying to figure out how to add links to previous posts and new posts within one category from the category page (or on a page that is pulling in one post from a specific category). I found all of the info about this:

    <?php previous_post_link(‘%link’, ‘Previous’, TRUE); ?>
    <?php next_post_link(‘%link’, ‘Next’, TRUE); ?>

    in the codex and forums, but they only seem to work on the single.php page – which won’t work for me, because there are two categories that are sort of being held separately from all the rest. So there may be 10 categories that will be lumped together (and thus previous and next links do not need to be in the same category) but for those 2 special categories, the next and previous links must stay within their same category.

    SO, I need to be able to post to the previous and next posts in a category from a page other than the single.php.

    Any help is appreciated!

Viewing 1 replies (of 1 total)
  • <?php next_posts_link(‘« Older ..’)`
    <?php previous_posts_link(‘Newer … »’)`

    This is what I use on my category pages (on my category.php) and you stay within the category. Look good, it reads posts.

    Now if you use excerpts on your category page, then:
    As soon as you click a header of a post you move to single.php and there the post argument + TRUE keeps you within the category.
    But, it does that of course for all posts, regardless of their category.

Viewing 1 replies (of 1 total)
  • The topic ‘Previous Link on Category Page’ is closed to new replies.