WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a custom post type called 'auctions', and i'd like to be able to visually differentiate auctions from posts and pages in the backend by assigning a different background color to the auction post type.

this could be easily achieved if i had a way to assign a body class to admin pages pertaining to this specific post type, except i'm not sure as to how i'd go about that :).

any help would be greatly appreciated. thanks!

share|improve this question
up vote 1 down vote accepted

Easy and your css to overwrite the default style like this

add_action('admin_print_styles', 'auctions_admin_print_styles_332');

function auctions_admin_print_styles_332(){
   if ((isset($_GET['post_type']) && $_GET['post_type'] == 'auctions') || (isset($post_type) && $post_type == 'auctions')){

     //include your css file using wp_enqueue_style() somthing like 
      wp_enqueue_style( 'handle name', plugins_url('/style.css', __FILE__), array(), '1.0' );

      // or a more hackish way would be to echo out the css style tag

so the class you are looking for is actualy an id "wpwrap" so you can use something like this:

<style type="text/css">
#wpwrap{background-color: #FFF;}

Hope this helps

share|improve this answer
thanks alot, this seems to have solved it for me. – pereyra Feb 8 '11 at 15:43

Your Answer


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.