-
-
Save loorlab/aae8336eac2bda58764d727c772b0269 to your computer and use it in GitHub Desktop.
Remove a particular body class in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php | |
/** | |
* Exclude body_class for front page - Remove CSS class : page | |
*/ | |
function mp_remove_body_classes($classes, $class){ | |
foreach($classes as &$str){ | |
if(strpos($str, "page") > -1 && is_front_page()){ | |
$str = ""; | |
} | |
} | |
return $classes; | |
} | |
add_filter("body_class", "mp_remove_body_classes", 10, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment