WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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. – Chris Carson Aug 7 '11 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 '11 at 4:55

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' );
share|improve this answer
up vote 0 down vote accepted

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...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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