Hi there,
1. Add this PHP Snippet to your site:
add_filter( 'body_class', function( $classes ) {
if ( is_single() ) {
global $post;
foreach( ( get_the_category( $post->ID ) ) as $category ) {
$classes[] = 'cat-' . $category->category_nicename;
}
}
return $classes;
} );
This will add a class of cat-slug
to your single post body tag.
2. Then you can use this CSS:
.single.cat-slug {
/* your css styles here */
}
Change the slug to match your category term