I have several portfolio sections at my site: 4 pages, each showing another portfolio category.
When I’m on a single portfolio item, then I have the navigation on top of it:
<– previous entry
–> next entry
The code for this is in single-portfolio.php:
<?php previous_post_link('<span class="previous_post_link">%link </span>'.__('(previous entry)','avia_framework')); ?>
<?php next_post_link('<span class="next_post_link">'.__('(next entry)','avia_framework').' %link</span>'); ?>
My problem is, these links “next” and “previous” make no difference, in which “portfolio category” I am at this moment:
they navigate through all portfolio categories.
That means, for example I am currently viewing a single portfolio item in category “acryl”, and the “next” link on top of it leads me to an item from category “oil”, depending on what I have posted after this item.
But I would like, that the “next” and “previous” navigation on top of this single portfolio items remains in ONE category. So I would like to change this code to something like this:
“show the next and previous link only to posts within this category from which this portfolio post is, that you are seeing here”
How can I change the code mentioned above please?
Unfortunately it’s currently not possible because WP doesn’t offer a parameter to exclude certain categories or post types. We discussed the issue here: http://www.kriesi.at/support/topic/portfolio-previousnext-entry-in-same-category
Plugins like: http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/ may work but I haven’t tested it.
The topic ‘Several portfolios: how to show next-previous navigation only for current cat?’ is closed to new replies.