Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The body_class hook seem only to work with non-admin pages. When I do

add_filter('body_class', 'add_body_classes');
function add_body_classes($classes) {
        $classes[] = 'myclass';
        return $classes;
}

Is there another hook i should be using if i want to add a class to the body of an admin page?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Admin doesn't use body_class() template tag, use admin_body_class filter too add classes to admin body tag.

share|improve this answer
add comment

one of the hooks i use for editing WP admin/Dashboard admin_head

    function remove_screen_options(){ 

    $hideCSS = '<style>#screen-meta-links { display: none; }</style>';

} 

Will put the css in your admin part

And by using class .wp-admin you could style the body part of admin.

Good luck

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.