Created
February 22, 2014 10:55
-
-
Save onishiweb/9151982 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
/** | |
* Include useful classes in body_class and post_class | |
*/ | |
function dig_add_useful_classes($classes) { | |
global $post; | |
if( ! is_tag() ) { | |
$classes[] = dig_get_post_type_class(); | |
} | |
if( is_page() ) { | |
global $post; | |
$classes[] = 'page-' . $post->post_name; | |
} | |
return $classes; | |
} | |
add_filter('post_class', 'dig_add_useful_classes'); | |
add_filter('body_class', 'dig_add_useful_classes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment