I need to have a special css for a special category.
CIt would also be usefull to Append a Pre-test – Could be the category name itself – to the post titles in this special category.
How could I do this (what would be the best method)?
My idea about css would be to insert some css class if the post would have this category but I don’t know if this would be too heavy for the site. About the pre-text to the Post title, I have no clue how to do it.
Can you give me a push here?
WP appends the category as a class to the body element. I.e.:
<body id='top' class="archive category category-offer-and-promotions en">
<body id='top' class="archive category category-your-world en">
So basically you need to write your css code like:
Pre text is a bit more complex but it’s possible by using conditional tags: http://codex.wordpress.org/Conditional_Tags
The topic ‘special css for a certain category’ is closed to new replies.