Add Custom Body Class To Genesis

When creating a custom template for a page, it is useful to be able to give that template a custom body class.

This snippet can be added to the top of your page or post template php file to do that.

1
2
3
4
5
6
// Add custom body class to the head
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
   $classes[] = 'name-of-css-class-goes-here';
   return $classes;
}