style sidebar widget based on category page
-
Hi,
Currently redesigning a website and I know how to use is_category() in the page but in the sidebar I’m confused. I am using Advanced Random Posts to randomly display 10 posts from specific categories. This works great as a sidebar widget. Currently the site uses a different sidebar for each category simply to style sidebar elements to match the category style (it’s pretty much only for color, i.e. arts category is purple, features is blue, etc…)
I don’t want to make multiple sidebars just to change color for each category. In page.php i can use the is_category statement to determine the color(s) of the page based on the current category but have been unable to do this in the sidebar.
How can I style the sidebar based on the category that the user is currently viewing?
THANK YOU
- The topic ‘style sidebar widget based on category page’ is closed to new replies.