I want to add a class to my css if a category is displayed but I can’t get it to work.
I added this to my header:
if ( is_category(‘areas’)) { echo ‘ class=”myclass” ‘; }
I want to add this class to my stylesheet to any page in this category so It changes the look of any page in that category. It isn’t working though.
Ive read through a lot of the codex and this is all I can figure to do
Any suggestions?
Probably easiest to up WP’s bodyclass; that will put in all the body classes you will need. With
in header.php, it will output something like
The call that class in CSS, i.e.
See http://codex.wordpress.org/Function_Reference/body_class