WordPress.org

Ready to get started?Download WordPress

Forums

Select different style sheets in child theme (4 posts)

  1. perbr543
    Member
    Posted 1 year ago #

    I have a child theme where I want to add possibility to select different color schemes using the Theme Customizer. When the user select a color scheme for example "blue" I want the css file blue.css to be loaded in the child theme. All the color scheme style sheets should inherit style settings from the parent theme and from a default style sheet from the child theme.

    Blue color scheme selected:
    Child theme\color\blue.css loaded and imports
    Child theme\style.css which imports
    Parent theme\style.css

    Green color scheme selected:
    Child theme\color\green.css loaded and imports
    Child theme\style.csss which imports
    Parent theme\style.css

    etc..

    Anyone knows how to solve that? It would also be an ok solution to have all child theme style changes included in the different color schemes css files (so the Child theme\style.css is not needed.

  2. 10tklz
    Member
    Posted 1 year ago #

    You could try a plugin such as WP Theme Options.

  3. perbr543
    Member
    Posted 1 year ago #

    Thanks for the reply but I do not want to use a plugin.

  4. 10tklz
    Member
    Posted 1 year ago #

    I understand. Here is a tutorial on adding a CSS style switcher to you theme.

Topic Closed

This topic has been closed to new replies.

About this Topic