Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Filter Body Class for WordPress
add_filter( 'body_class', 'extra_body_class' );
// Add specific CSS class by filter
function extra_body_class( $classes ) {
if ( is_single( 'blank-title-and-content-page-template-in-genesis-theme' )) // Set conditionals - example is using a slug
$classes[] = 'bare-bones';
return $classes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment