Adding other stylesheets for every category.
-
Hello, I’ve got this problem. I want to use different stylesheets for different categories. I am using a wordpress theme with e-panel, if that helps. (You could probably do that using this, or on its own.)
I’ve found something like this (and put this in header.php):
if (is_category('style-Red')) {echo 'class="cucumber-green"';}
But I need to change this, so that: if category X is open it opens the normal stylesheet(style.css) + the child stylesheet (called for example style-category-x.css). If homepage is open it just opens the style.css.
Ps; It would be also nice to find a way, so that when I have 300 categories, it will be a lot of “if is category”, but I will have a lot of categories as 2-3rd levels (child categories), is it possible if Category: style-Red has child themes they will also use the same style-red.css?
- The topic ‘Adding other stylesheets for every category.’ is closed to new replies.