Skip to content

Instantly share code, notes, and snippets.

@kamalinfo
Last active December 23, 2017 11:48
Show Gist options
  • Save kamalinfo/6a317b38947eb5f89b2c7a73e78b15c1 to your computer and use it in GitHub Desktop.
Save kamalinfo/6a317b38947eb5f89b2c7a73e78b15c1 to your computer and use it in GitHub Desktop.
<?php
function themename_body_classes( $classes ) {
// body calss for page
if ( is_singular( 'page' ) ) {
global $post;
$classes[] = 'page-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'themename_body_classes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment