I’ve made my first theme and now I want to create different “profiles”. These profiles are just independent CSS files that user can try. The point is, how to make these files to allow users to choose the color scheme through the admin panel? It is, I don’t want to allow users to access to the file system, so they will have to change the CSS file using the admin panel. How to do it? Is there any plugin that allows to change CSS files?
Leave a Reply
You must be logged in to post a comment.
This article should answer your question:
Add a style switcher to your wordpress theme
The article that I have linked above explains and walks you through on how to add a stylesheet switcher to your admin panel for your theme.
It walks you through on how to use and add options to your theme. This is particularly intuitive if your developing a theme for a client who once in a while may want to change their colors / imagery or something on a whim.
I have used this numerous times when theme developing. Also in using this method you can add as many stylesheets as your heart desires.
You can setup some settings within your backend to have the user choose which stylesheet they want and on init, check the value and depending on the value of that setting, enqueue different stylesheets.
You could also create child themes that differ only in their CSS, and let the user change between them using the same method for changing themes.
The up side of this is that the theme switching screen shows screen shots of the theme, so the user can tell what their site will look like after changing the CSS.