Skip to content

Instantly share code, notes, and snippets.

@techmuzz
Created May 22, 2019 00:35
Show Gist options
  • Save techmuzz/3aea126fbbbc9d9108ea9b2bfe47babe to your computer and use it in GitHub Desktop.
Save techmuzz/3aea126fbbbc9d9108ea9b2bfe47babe to your computer and use it in GitHub Desktop.
function remove_archive_body_class( $classes ) {
if ( is_archive() ) {
foreach ( $classes as $key => $value ) {
if ( $value == 'archive' ) unset( $classes[$key] );
}
}
return $classes;
}
add_filter( 'body_class', 'remove_archive_body_class', 20, 2 );
function remove_CLASS_NAME_body_class ( $wp_classes ) {
foreach ( $wp_classes as $key => $value ) {
if ( $value == 'CLASS_NAME' ) unset( $wp_classes[$key] );
}
return $wp_classes;
}
add_filter( 'body_class', 'remove_CLASS_NAME_body_class', 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment