getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Bug fix body class #194

Closed neilberry001 closed 11 years ago

neilberry001 commented 11 years ago
function tanlinell_body_classes( $classes ) {

    global $wp_query;

    // Adds a class of group-blog to blogs with more than 1 published author
    if ( is_multi_author() ) {
        $classes[] = 'group-blog';
    }
    if($wp_query->queried_object) {
        if ( in_array($wp_query->queried_object->post_type, array('post','page') ) ) {
            $classes[] = $wp_query->queried_object->post_type.'-'.$wp_query->queried_object->post_name;
        }
    }

    return $classes;
}
add_filter( 'body_class', 'tanlinell_body_classes' );

blog archive listng dont like this investigate