Remembering taxonomy term when viewing post
-
Just wondering if there is a way to remember the taxonomy term when viewing a post if you came through a taxonomy listing page.
for example i have a custom taxonomy called ‘sectors’ in this i have ‘commercial’, ‘education’ and ‘health’
I have a custom post type called casestudies and have a case study setup and have given it the taxonomy ‘commercial’ AND ‘health’
If i go to:
/sectors/healthsectors-taxonomy.php kicks in and my case study is listed. If i then click on this case studiy it loads the post using single-casestudy.php
However I would like to know within the code of single-casestudy.php that i came through via ‘health’ so i can show other case studies in the health taxonomy on the page. I am not interested that it also has the commercial one.
Is there a neat way to carry this over? In traditional development you’d put the category in the querystring or in a cookie so the details page could use it to drive those kinda things.
e.g. you are on something likse listcase.php?category=2 and the link to the case study would be /viewcase.php?id=1&category=2.I could do this in WordPress or use a cookie, but i thought there might be a more elegant way to do it?
The topic ‘Remembering taxonomy term when viewing post’ is closed to new replies.