Last active
August 9, 2016 12:38
-
-
Save waynebcox/61b9bdc02eb0ec7e2cb278bdc251745e to your computer and use it in GitHub Desktop.
[ Genesis ] Create body class based on permalink slug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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