Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created October 10, 2012 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/3868835 to your computer and use it in GitHub Desktop.
Save jaredatch/3868835 to your computer and use it in GitHub Desktop.
Remove classes from body_class()
<?php
/**
* Remove classes from body_class()
*
* @param array $wp_classes
* @return array
*/
function ja_remove_body_classes( $wp_classes ) {
// The classes you wish to remove
$blacklist = array( 'reply' );
// Remove classes from array
$wp_classes = array_diff( $wp_classes, $blacklist );
// Return modified body class array
return $wp_classes;
}
add_filter( 'body_class', 'ja_remove_body_classes', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment