<?php
function add_body_classes( $classes ) {
// Adds a class if post type is Book
if ( is_singular('book') ) {
$classes[] = 'book-single';
}
// Add a class if is not Home Page
if ( ! is_home() ) {
$classes[] = 'not-home';
}
// Add a class if user is Admin
if ( current_user_can('administrator) ) {
$classes[] = 'user-is-admin';
}
return $classes;
}
add_filter( 'body_class', 'add_body_classes' );
?>