Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active March 7, 2017 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save neilgee/9c744bfeb7399d101b18 to your computer and use it in GitHub Desktop.
Save neilgee/9c744bfeb7399d101b18 to your computer and use it in GitHub Desktop.
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