Here’s what I am doing right now. In my header.php file: <?php if ( current_user_can( 'subscriber' ) ){ textdomain_body_classes(); } else { relax(); } ?> In my functions.php class:...
I would like to add a body class depending on what sidebars are active, and a body class if my before-header widget area is active. I have got it...
I want to conditionally add a body class depending on what template is being used. I can’t figure out why the following code is not working… function damsonhomes_body_classes( $classes...
I tried with the bellow code to assign a body class to a page with a custom template, but this didn’t work. What is wrong here? function prefix_conditional_body_class($classes) {...
I want to remove the default body class on the theme and add a new class. I use this code to do this: //REMOVE / ADD HOME CLASS FROM...
I have created a radio button field with ACF so that admin can specify a colour. E.g: blue : Blue pink : Pink I’d like this to be output...
I want to add styles to editor-style.css, based on the category the current post belongs to. Therefore I would like to add the post classes – using get_post_class() –...