How to define a class to category AND subcategory
-
Sorry in advance for my bad english ??
I am searching how to define a class to a parent category AND the childs categories.
This is the code I’m using for the parent category :<h1 <?php if (is_category('fruits')) {echo 'class="fruits"';} if (is_category('vegetables')) {echo 'class="vegetables"';} ?>><?php echo single_cat_title(); ?> </h1>
This code works fine for the parent category, of course. But how to define it ALSO for the subcategories ?
Thank you in advance !!
- The topic ‘How to define a class to category AND subcategory’ is closed to new replies.