Smart link to (last) category on post
-
Hey there,
I hope this is the right section for my question. I haven’t found any solution throughout the net yet, maybe I chose the wrong words to search..
Question clean and dry: Is there a way for WordPress to know on a post from what category the visitor came from, so it could link to the corresponding category (parent vs. child category)?
Explanation: I have a category with three child categories, e.g. ‘Fruit’ and three subcategories named ‘Apples’, ‘Bananas’ and ‘Peaches’. All of my posts go into these child categories. I set up an archive page for all posts filed under ‘Fruit’, which of course includes those from its child categories. On that archive page, you are able to click on a list with links to each subcategory in order to move to their archive and e.g. only see ‘Banana’ posts. On each post at the top, there is a link reading like ‘Back to index’ that should link to the last category overview the person was at, meaning: if he or she came directly from the ‘Fruit’ archive, take him/her back to it, if it was the ‘Banana’ category, go back there. Is that somehow possible for WordPress to detect the last category (archive) clicked on and link back to it accordingly?
The easiest, but merely senseful way would be a JS history.back link. If I just hadn’t links to next/prev posts there as well that enable the user to navigate sideways through a category. Any ideas on this one?
Thanks a lot
physalis
- The topic ‘Smart link to (last) category on post’ is closed to new replies.