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.

I'm using the standard WP Custom Backgrounds feature, however, the color is defaulting to #166b4c and I'm unsure why. #166b4c does not appear in my stylesheet. Below is my code.

    add_theme_support( 'custom-background' );
    $defaults = array(
        'default-color'          => '000',
        'default-image'          => '',
        'wp-head-callback'       => '_custom_background_cb',
        'admin-head-callback'    => '',
        'admin-preview-callback' => ''
    );

add_theme_support( 'custom-background', $defaults);

Live example: http://themeforward.com/demo2/

share|improve this question
    
Can you post an URL? –  s_ha_dum Feb 13 '13 at 16:01
    
Posted, see updated question. –  AndrettiMilas Feb 13 '13 at 16:29
    
Two different rules for body.custom-background are being inserted. Any idea why that is? View source to see what I mean. –  s_ha_dum Feb 13 '13 at 16:39
    
Thanks, that solved it. I had rogue code floating around. –  AndrettiMilas Feb 13 '13 at 16:46
add comment

1 Answer

up vote 1 down vote accepted

You have to pass the $defaults as the second parameter to add_theme_support() per the Codex

$defaults = array(
    'default-color'          => '000000',
    'default-image'          => '',
    'wp-head-callback'       => '_custom_background_cb',
    'admin-head-callback'    => '',
    'admin-preview-callback' => ''
);

add_theme_support( 'custom-background', $defaults);
share|improve this answer
    
For some reason this is still not changing the background color. Background images work, but not color. –  AndrettiMilas Feb 13 '13 at 15:57
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.