I would like to create color scheme for my custom template that can be changed inside my admin panel. According to this thread it can “easily” be done.
Author quotes: “create your color styles in seperate style sheets and name them like so. blue.css – black.css – brown.css – ect…. Then in your admin options panel you could add something simple like this”:
array( "name" => "Color Scheme", //color scheme
"desc" => "Select the color scheme for the theme",
"id" => $shortname."_color_scheme",
"type" => "select",
"options" => array("black","blue","brown","green","grey","orange","purple","red","white","yellow"),
"std" => "blue/blue"),
Now what I don’t understand is Where to add that code? I tried adding this to my: functions.php and index.php but it breaks my theme! This is my first time I am trying to create something like this so i am sorry for my noob question.
Can somebody help me how to add this functionality?
Thank you guys!!
Here is the answer to my question…
Add this to your functions.php
Next step is to add code to header.php:
And last step is to add our css file (I will name it red.css) and style it like this:
And you are done!! Hope this will help somebody else!!