We created a theme that has a lot of changes in it. Now we want to enable that theme on our site in different colors, and a few images different:

enter image description here

What we're doing is duplicating the theme, and then making a few changes in the CSS, and change a few images. But it seems an overkill - to copy the all the theme files just to make so few changes. Moreover, if we ever have to change something functional in the theme, we'll have to go through all the duplications and apply it.

Is there a way to give users the option of changing colors & images, without duplicating the theme?

  • 2
    By users do you mean "website visitors" or "owners of different blogs on our site who choose a background for their blog"? You're totally right that you should not duplicate the theme, but how you go about it kind of depends on the answer to this question. Aug 7, 2011 at 13:27
  • Thank you for your question. By users I mean "owners of different blogs on our site who choose a background for their blog"
    – Lea Cohen
    Aug 8, 2011 at 4:55

2 Answers 2


I would create a Theme Option for Color Scheme, then split out the color-scheme-specific CSS declarations into separate CSS files (e.g. blue.css, green.css, red.css, etc.).

Then, you simply enqueue the appropriate color-schme stylesheet, based on the Theme Option.


function mytheme_enqueue_color_scheme_stylesheet() {
    $theme_options = get_option( 'theme_mytheme_options' );
    $colorscheme = $theme_options['color_scheme'];
    $stylesheet = $colorscheme . '.css';
    $stylesheetsrc = get_template_directory_uri() . '/css/' . $stylesheet;
    wp_enqueue_style( 'colorscheme', $stylesheetsrc );
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_color_scheme_stylesheet' );

We ended up using child themes, mainly because the site manager wanted to get a preview of the color change that would occur when changing CSS, and that was done best by the theme switching page, but also because it was easier...

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.