0

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/

4
  • Can you post an URL?
    – s_ha_dum
    Commented Feb 13, 2013 at 16:01
  • Posted, see updated question. Commented Feb 13, 2013 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
    Commented Feb 13, 2013 at 16:39
  • Thanks, that solved it. I had rogue code floating around. Commented Feb 13, 2013 at 16:46

1 Answer 1

0

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);
1
  • 1
    For some reason this is still not changing the background color. Background images work, but not color. Commented Feb 13, 2013 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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