Md Mehedi Hasan

body_class | post_class | remove/add class from functions

<body <?php body_class(); ?> >
<body <?php body_class("our_custom_class"); ?> > // bad practice
<body <?php body_class(array("first_class","second_class")); ?> > // good practice
function alpha_body_class($classes){
	unset($classes[array_search("no-customize-support", $classes)]); // Removing Classes from body tag
	unset($classes[array_search("wp-custom-logo", $classes)]); // Removing Classes from body tag
	$classes[]="newClass"; // Adding New Class in body tag
	return $classes;
}
add_filter( "body_class", "alpha_body_class" );
<div <?php post_class(); ?>>
<div <?php post_class("our_custom_post_class"); ?>> // bad practice
<div <?php post_class(array("first_post_class","second_post_class"); ?>>// good practice
function alpha_post_class($classes){
	unset($classes[array_search("no-customize-support", $classes)]); // Removing Classes from post_class()
	unset($classes[array_search("wp-custom-logo", $classes)]); // Removing Classes from post_class()
	$classes[]="newPostClass"; // Adding New Class in post class
	return $classes;
}
add_filter( "post_class", "alpha_post_class" );