eatanicecream
Member
Posted 2 years ago #
Hi, I'm hoping that someone can help...this is driving me crazy!
I've set up a blog section of a site with three tabs and used categories to place posts in one of the three tabs. The active state on my tabs looks fine when viewing a list of posts, but when I click into the posts (permalink) the active class disappears so I have nothing that I can style.
I've tried the wp_classy_list plugin, but it doesn't help.
The bit I'm working on is here if it helps: http://www.actsa.org/newsroom
Many thanks
This is not precisely what you're after, but might achieve the same thing.
By wrapping the list element inside a div, you could then add an if clause to check that it's in the category:
if(in_category('whatever'))
to define a special class for that div only if it's a single page in that category. Then you could style the list element only within that active div class accordingly.
eatanicecream
Member
Posted 2 years ago #
Thanks - worked it out in the end. Partly used your solution but also had to set up different templates for different single post categories and use the wp_list_categories instead of wp_lists_pages for the menu.
Hours of fun :-)