Jump to content
Sign in to follow this  
brandonalanagmailcom

Category specific navigation

Recommended Posts

brandonalanagmailcom

I've added my two categories "documents" and "news" to the menu, which basically displays a list of posts under documents and news on separate pages respectively. However, once the reader selects a post from either page, the navigation menu advances through all the categories. Is there a way to have the 'next' or 'previous' links category specific? I'm using PlatformPro

Share this post


Link to post
Share on other sites
kastelic

Hmm, seems like it should be category specific. Are you sure some of the posts aren't in multiple categories? How about a link to your site?

Share this post


Link to post
Share on other sites
kastelic

You'd have to go into section.pagenav.php (hopefully you're child-theming) add a parameter to the next_post_link() function, TRUE which is the parameter for staying within the category. `<?php next_post_link('%link', TRUE) ?>` Do the same for Previous Post of course.

Share this post


Link to post
Share on other sites
brandonalanagmailcom

Wasn't able to locate section.pagenav.php I was in the in Appearance>Editor>PlatformBase I even checked PlatformPro and wasn't able to locate that file. Would it be somewhere else?

Share this post


Link to post
Share on other sites
brandonalanagmailcom

Jimmy, I figured out where the section.pagenav.php file is. I added the parameter you gave me, but is still did the same thing - navigating through all of the categories and plus it was no longer displaying the post titles in the navigation as well.

Share this post


Link to post
Share on other sites
brandonalanagmailcom

Ok, I figured out how to do what I wanted. Locate file section.postnav.php by following this path: wp-content>themes>platformpro>sections>wp>section.postnav.php Then locate this code in the form: <?php next_post_link() And include the code as is: <span class="previous"><?php previous_post_link('%link','%title', TRUE) ?></span> <span class="next"><?php next_post_link('%link', '%title', TRUE) ?></span>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×