Add Custom Class to Body
Adds a custom class to the body tag
PHP
function add_custom_body_class($classes) {
$classes[] = 'my-custom-class';
return $classes;
}
add_filter('body_class', 'add_custom_body_class');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY