How to maintain sub navigation on a Wordpress page when on a post detail page
April 22, 2010 10:18 AM   Subscribe

I have a wordpress website that is using a custom page template that queries posts from a particular category. This page template has a sub nav(s) in its left column thats generated based on what top level page has been selected. All this works fine and the page template displays all the correct posts. The problem is the post items displayed in this page template link through to the post detail page (single.php) as this is the post detail page im not sure how to keep the relevant left column sub nav in place that relates to the section they where in? suggestions appreciated
posted by toocan to Computers & Internet (2 answers total)
Can you provide a link to your site?
posted by colorproof at 5:25 PM on April 22, 2010

If I'm understanding, you have multiple subnav configurations, and you want Wordpress to figure out which one is appropriate to display on a given single post page. If all the posts that currently would share a subnav menu have a category or tag in common, this would be pretty easy to code (just query the tag and have that generate the subnav). If the subnav is dependent on which page the user CAME from rather than a static thing tied to each post, then it's a bit trickier . . . you could possibly pass a variable in the link (it would look something like "" with the id # corresponding to the subnav option), then query that variable to generate the subnav.
posted by Fifi Firefox at 4:35 PM on April 23, 2010

« Older Can you help me with an Excel question?   |   What would you do with 30k in cash savings at 27? Newer »
This thread is closed to new comments.