Hello Peter,
How to set it for a specific category or set of categories yet leave it for others?
- Before you can do that, you will need to modify the body class of each post. To add category class in your post, you can add the code below in your child theme’s functions.php file:
add_filter('body_class','add_category_to_single');
function add_category_to_single($classes) {
if (is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = "mycategory-".$category->category_nicename;
}
}
// return the $classes array
return $classes;
}
Please note that I added mycategory- prefix to prevent conflict. So the class will be mycategory-category-name and in the custom css, you can have something like this:
.single-post.mycategory-category-name .x-container.main:before {
display: none;
}
Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.
Hope this helps. Please let us know how it goes.