Making "Next/Prev" buttons stay within child category
-
I’ve been scouring the web looking for a solution to this, maybe someone can help.
We have a photo site that’s got hundreds of images. It works in a custom way: The category is selected and thumbnails show (using category.php template). You click a thumbnail to see the ‘post’ in ‘single.php’ which includes a photo, description, etc. along with “Next / Previous” links.
The problem is, we have the posts in multiple categories which are children of two main categories. WordPress always defaults to the parent category when you click the thumbnail and load ‘single.php’, so the “Next /Previous” links always go to the main categories… we can’t navigate in the child categories. In other words, by clicking to the single.php, we ‘lose’ the information about what category the user has been exploring.
I’ve thought of passing the category from the category.php template to the single.php in a var (like the session or cookie), but maybe it’s in some WordPress array already? Passing the current category in the var is actually not straightforward: I haven’t figured it out yet… and then I’d have to make it work in the Next/Previous navigation, after that. I’ve been playing with “Ambrosite Next/Previous Post Link Plus” hoping there was a solution there, but no luck.
Any ideas?
- The topic ‘Making "Next/Prev" buttons stay within child category’ is closed to new replies.