Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Pinpoint › Limit categories on "next" and "previous" portfolio navigation?
New Landing › How can we help? › Themeforest Theme Support › Pinpoint › Limit categories on "next" and "previous" portfolio navigation?
Tagged: categories, Category, different, items, link, links, navigation, portfolio, really, results, several, site, something, Thanks, types, website
- This topic has 9 replies, 3 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Pinpoint
-
May 30, 2013 at 6:19 pm #6634
I’d like the ability to limit the categories that the “next” and “previous” portfolio navigation returns results from. We have several different types of projects on a website we’re developing, and I’d really like for the navigation to only pull the portfolios from a particular category. Is that a possibility?
To clarify, if we have a portfolio category of “retail”, I’d like the links at the bottom of the site that link you to the next and previous portfolio items to only link to the other portfolio items in that category. Is this something you could help us with? Thanks.
http://designpointdev.com/RDCWP/?portfolio=edgewater-crossing
May 31, 2013 at 2:37 pm #6690Hi,
WordPress only has the ability to specify if the next/prev posts linked should be from the same category, please read here: http://codex.wordpress.org/Function_Reference/next_post_link
You can implement the above in single-portfolio.php, at lines 177 and 178.
Regards,
————————————————————————————————————Cosmin
Support AssistantMay 31, 2013 at 5:18 pm #6729OK, so I added TRUE to the lines on 177 and 178 but instead of limiting the categories, it eliminated the links entirely. Here’s one of the lines, so you can tell me if I did this correctly or if I screwed it up.
<div class="nav-previous"><?php next_post_link(__('<i class="icon-chevron-left"></i> <span class="nav-text">%link</span>', 'swiftframework'), '%title', TRUE); ?></div>
June 3, 2013 at 3:18 pm #6918If you have no other posts in the category that post is from, it won’t show any next/prev links, as this limits navigation to posts within the same category.
Regards,
————————————————————————————————————Cosmin
Support AssistantJune 3, 2013 at 4:19 pm #6935Understood, however I’ve made sure that there were multiple posts. Was there anything wrong with the code I pasted?
The only other issue I could think of is that many of my portfolio items belong to multiple categories. Would that break it?
http://designpointdev.com/RDCWP/portfolio/the-recommendation/
June 5, 2013 at 7:25 pm #7242The code looks fine to me; Ed, is there something else that might prevent it from working correctly?
Regards,
————————————————————————————————————
Cosmin
Support AssistantJune 5, 2013 at 9:48 pm #7279Cosmin –
The only thing I can think of is having the portfolio items in more than one category.
June 6, 2013 at 10:54 am #7323Hi there,
This is actually an issue with WordPress, which is fixed by this plugin and it’s functions – http://wordpress.org/plugins/previous-and-next-post-in-same-taxonomy/
Hope that helps.
– Ed
June 6, 2013 at 4:14 pm #7388Hi Ed, I have installed and activated the plugin, and no changes. This particular video is only in one category which has several items. Still can’t understand why the code isn’t working, Any thoughts?
<div class="pagination-wrap portfolio-pagination full-width clearfix">
<div class="nav-previous"><?php next_post_link(__('<i class="icon-chevron-left"></i> <span class="nav-text">%link</span>', 'swiftframework'), '%title', TRUE); ?></div>
<div class="nav-next"><?php previous_post_link(__('<span class="nav-text">%link</span><i class="icon-chevron-right"></i>', 'swiftframework'), '%title', TRUE); ?></div>
</div>June 6, 2013 at 9:20 pm #7411Try changing the functions to:
be_previous_post_link()
be_next_post_link()As per the new plugin.
– Ed
-
Posted in: Pinpoint
You must be logged in and have valid license to reply to this topic.