Hi,
how can I add a extra class to the body tag without JavaScript?
I’m using a child theme.
Greez Jens
Found it out by my self … add this to functions.php.
// Add class to Body via Filter function
add_filter( 'body_class','add_body_classes' );
function add_body_classes( $classes ) {
$classes[] = 'classNameXYZ';
return $classes;
}
Hi!
Thanks for posting your solution. Let us know if you have any other questions.
Best regards,
Elliott
Hey there,
any solution to add a body class with the post author’s name?
thank you
Hi,
I’ve never tried it myself and the question might fit better on a general WordPress forum, there’s a thread about it on StackExchange which might help: http://wordpress.stackexchange.com/questions/39553/add-post-author-body-class-to-wordpress
Thanks,
Rikard