0
votes

I've added theme support for a custom background to my WordPress theme, as below, but the background colour is not actually being applied (note that the options are showing correctly in admin though).

According to the docs "When the administrator sets custom values for the theme, WordPress generates an extra style sheet in-line with the HTML headers." However, this is not the case.

The <body> tag is declared as <body class="home blog logged-in admin-bar customize-support">, with the promised custom-background class neither declared in the header nor applied to the <body> tag.

Is there something I'm missing here?

Here is how I am adding custom background support.

$ps_background_defaults = array(
    'default-color'          => '000000'
);
add_theme_support('custom-background', $ps_background_defaults);
1

1 Answers

0
votes

The problem was that I hadn't saved the custom background settings, and once I'd done that everything was fine.

This does seem like an issue with the core to me, as the default is ignored, and I am off to do some research on Trac now. I'll update with a ticket if one is opened.