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/

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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