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.

Using a child of Twenty Twelve, I've been adding color to all the major containers (#main, #content, #secondary, etc.) using

#arbitrary-id {
 background-color: #dedede;
}

This works for everything but body. I should be more clear: it changed the body background color until I messed with the background color in "Appearance -> Background". Now no matter what I try, I can't override that.

Looking in the HTML of the page and inside the <head> I see:

<style type="text/css" id="custom-background-css">
body.custom-background { background-color: #e6e6e6; }
</style>

Naturally, I tried to change the color using that selector, but since it's generated internally, that trumps the external CSS.

I'm at a total loss for how to do this. How do I change the background color of the body using CSS?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

It sounds like you just need to remove support for the custom background color.

remove_theme_support( 'custom-background' );

You will probably need to hook it to get it to run after the parent functions.php

function disable_bg_wpse_97248() {
    remove_theme_support( 'custom-background' );
}
add_action('after_setup_theme','disable_bg_wpse_97248',100)
share|improve this answer
    
That worked perfectly. You are a gentleman and a scholar. I'm very new to all this so I appreciate the full explanation. –  Tomulent Apr 25 '13 at 18:09
add comment

Look in your functions.php for somehting like:

add_theme_support( 'custom-background', array(
    'default-color' => 'e6e6e6',

Remove it, then you can use your CSS to change the background color.

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.