![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I need to style a website with different colors on different pages. For posts and pages I use the options at layout settings to make bodyclass for the color. It works perfect.
Now I need the same for category-pages. But there I can only choose a layout at the layoutsettings. No option the create a bodyclass for a specific category at the backend of WordPress. Now I can combine a category and a bodyclass in functions.php but that is not really user friendly. Why is there no way to add a bodyclass at layout settings at the categories and is there a way to add this box? |
|
#2
|
||||
|
||||
|
WordpRess already adds category-specific body classes.
View the html source of the page and look at the classes added to the body tag.
__________________
***** These forums were CLOSED to new posts on November 19th, 2012. New forums are here: http://www.studiopress.com/forums/ and you will need to SIGN UP AGAIN. If you need assitance with setting up your theme, go to http://my.studiopress.com/ and read the SETUP links or the TUTORIALS link on the side tab. If you need Account Assistance, file a help desk ticket at the same location. |
|
#3
|
|||
|
|||
|
I don't need category specific body classes. I need to add a custom body class to a category. For example. The site I need this for has webpages with pink, green, orange or blue text. So I added for the pages the bodyclasses pink, green, orange or blue and defined the css for this bodyclasses. I need to do the same for the category pages
|
|
#4
|
||||
|
||||
|
What I'm saying is to use the category body classes. Add them to your predefined classes.
__________________
***** These forums were CLOSED to new posts on November 19th, 2012. New forums are here: http://www.studiopress.com/forums/ and you will need to SIGN UP AGAIN. If you need assitance with setting up your theme, go to http://my.studiopress.com/ and read the SETUP links or the TUTORIALS link on the side tab. If you need Account Assistance, file a help desk ticket at the same location. |
|
#5
|
|||
|
|||
|
Then everytime a category is added they need me to add the category class to the style.css. That is not what I want. WIth the custom body class of the layoutsettings it's going automatically, without my interverance. Like I do on the pages and the other post types. I want something like that on the categories. So I have the color as the bodyclass.
|
|
#6
|
||||
|
||||
|
There isn't anything...
But you can just use "category" as a body class. That will apply to all categories even when they make new ones.
__________________
***** These forums were CLOSED to new posts on November 19th, 2012. New forums are here: http://www.studiopress.com/forums/ and you will need to SIGN UP AGAIN. If you need assitance with setting up your theme, go to http://my.studiopress.com/ and read the SETUP links or the TUTORIALS link on the side tab. If you need Account Assistance, file a help desk ticket at the same location. |
| Tags |
| body class, category, layout settings |
| Thread Tools | |
| Display Modes | |
|
|
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us