Create a gist now

Instantly share code, notes, and snippets.

Filter Body Class for WordPress
<?php
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