Skip to content

Instantly share code, notes, and snippets.

@waynebcox
Last active August 9, 2016 12:38
Show Gist options
  • Save waynebcox/61b9bdc02eb0ec7e2cb278bdc251745e to your computer and use it in GitHub Desktop.
Save waynebcox/61b9bdc02eb0ec7e2cb278bdc251745e to your computer and use it in GitHub Desktop.
[ Genesis ] Create body class based on permalink slug
//* Add a body class to single pages based on slug
add_filter( 'body_class', 'wc_body_class_for_pages' );
function wc_body_class_for_pages( $classes ) {
if ( is_singular( 'page' ) ) {
global $post;
$classes[] = 'page-' . $post->post_name;
}
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment