This function gives the body element different classes and can be added, typically, in the header. Expand full source code Collapse full source code View on Trac. For example, to add a unique class to the same template used above:. To add the following to the WordPress Theme functions. The above example about how to remove inline classes via filters is incorrect. Here is the correct way to do it:. List of all default static classes which are added to. Expand full source code Collapse full source code. Add one custom body class to the entire site, as well as additional classes only where needed by conditionally targeting the page slugs. In this example the site makes use of front end registration, login and password reset forms, so the goal is to modify the form styling only on these pages:.
Making Web Technology Purr for Cats of All Stripes
Probably for styling purposes. Frontend Masters is the best place to get it. Just be careful that no category conflicts with an existing necessary body class. I second that. This would be a very elegant solution. I removed just that argument and this works perfectly. I found the same thing as Kaela. Thanks very much! This way, I can make styling adjustments to the post layout based on category.
Sophie Lynx. Age: 31. EXCLUSIVE PORN STAR ESCORT SOPHIE LYNX available for local meetings. Services: Sex In Different Positions, Oral, Oral With Condom, Kissing, Kissing With Tounge, Cum On Body, Deep French Kiss, 69 Position, Extra Ball, Erotic Massage, Striptease.
Add Parent Category Id to Body Class
Once in awhile you may want to apply some CSS to all descendants of a particular Page. So I might use a special background color, font color, accent color, or really any other page characteristic for a particular Page and everything underneath it. Another popular idea would be to use a special background image or header image for an entire section. If this sounds scary, get a developer to do it for you. The following code goes into the functions.
It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I am not a coder, but I usually get by with Wordpress by doing my research and find my solution. I can't find what I need to do this time so I have attempted to crib together some code - what I am attempting to do is, when I am on the Category Archive, I want to add a body class of the category parent. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?