- This topic is empty.
April 18, 2013 at 3:30 pm #44224
I have a parent category titled ‘Latest’ and its children categories titled ‘Painting,’ ‘Illustration,’ ‘Photography,’ etc. I’m using the following code in my single.php page from [Wordpress Codex](http://codex.wordpress.org/Template_Tags/next_post_link “http://codex.wordpress.org/Template_Tags/next_post_link”) to get the pagination to flip through posts within the same child category. All works well.
However, when I enter the post from the parent category, it reverts back to flipping through posts within the child category it pertains to, not the parent. I was hoping to get it to work for parent too. Apparently, it confuses visitors.
I was suggested to use [Ambrosite Next/Previous Post Link Plus](http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/ “http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/”) plugin, but it doesn’t seem to help my problem.
I’ve been trying really hard to get this to work (with and without plugin) but with no luck. I thought it would be simple to do. If anyone can help me, I’d greatly appreciate it!April 18, 2013 at 5:02 pm #132369
I seem to have solved the problem. Use the code above from WordPress Codex. Then make sure that each post has child and parent categories checked off when managing each post.
I only had child category checked off which is probably why the pagination wasn’t working correctly when entering a post from the parent category.
Simple solution. Not sure why I didn’t see that. Sorry about that.April 18, 2013 at 5:05 pm #132370
I would like to mark this topic as solved, but I don’t see that option. Anyone?April 18, 2013 at 5:20 pm #132371
Found it. Done!April 23, 2013 at 1:30 pm #132895
I thought I solved the problem but I just realized I didn’t. Now that I have both child and parent categories checked off, when entering the post from the child category, it flips through the parent category.
I learned and tried using Sessions and Taxonomies but it didn’t work. Then again I’m very new to Sessions and Taxonomies so maybe I’m not understanding something.
Again, I’m trying to get the next/previous post links to work within the same category for child and parent. Is this possible?
- The forum ‘Other’ is closed to new topics and replies.