Body_class wordpress doest work
I was trying to put a class inside html body tag with php for my wordpress theme. I am looking at wordpress code and I have to use the following and add it to my functions.php file:
add_filter( 'body_class', 'my_class_names' );
function my_class_names( $classes ) {
// add 'class-name' to the $classes array
$classes[] = 'class-name';
// return the $classes array
return $classes;
}
Only it doesn't work for me. Does anyone know what this might be?
Casper
+3
source to share