I've had an issue with the theme customizer.

On this page http://codex.wordpress.org/Theme_Customization_API you can go to:

Part 2: Generating Live CSS

And you'll see a way to fetch the settings and output CSS into the page header using the wp_head action hook.

The problem I've had is that the color settings don't show up if left as default. So if I install the theme, and leave it as is, my header will show this

.right-front-page-boxes a, .sidebar-buttons a {
background-color: ;

Which does not validate, and shows a background-color parse error.

But then, if I use the theme customizer to change the color, I can then go back to the page source and it will show this:

.right-front-page-boxes a, .sidebar-buttons a{
background-color: #5a5af2 ;

This, of course, validates.

I cannot figure out why this would happen. I would think the settings defaults would be used instead of leaving blank CSS.

Any ideas?

The function is properly adding the CSS to the header, however, it appears get_theme_mod() doesn't do anything until it has actually been modified by using the theme customizer.

It seems that this would keep potential themes from being accepted into the WordPress directory due to the inability to validate?

1 Answer 1


I answered my own question. I had the defaults set in the customizer settings, but not in the get_theme_mod() function.

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.