mardi 24 mars 2015

From child theme remove class which is added by parent theme?


So the parent theme adds masonry in the body class by



function water_lily_body_class( $classes ) {
if ( !is_singular() && !is_404() && !is_author() )
$classes[] = 'masonry';
return $classes;
}
add_filter('body_class','water_lily_body_class');


Now in my child theme i don't like to have the masonry class for category blog, so in the parent functions.php i just add the



&& !is_category('8')


But i like to have a function in my child theme's functions.php which removes the body class masonry something like



function remove_masonry_body_class( $classes ) {
if ( is_category('8') )
//$classes[] -= 'masonry';//remove masonry???
return $classes;
}
add_filter('body_class','remove_masonry_lily_body_class');


Any idea how to strip the masonry class??





Aucun commentaire:

Enregistrer un commentaire