Created
January 12, 2018 13:02
-
-
Save maycomayco/373b263bd87f8d792b2455e5ef893ec8 to your computer and use it in GitHub Desktop.
This file contains 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_filter( 'body_class', 'knx_body_class_for_pages' ); | |
/** | |
* Adds a css class to the body element | |
* | |
* @param array $classes the current body classes | |
* @return array $classes modified classes | |
*/ | |
function knx_body_class_for_pages( $classes ) { | |
global $post; | |
$classes[] = $post->post_name; | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment