Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have created a theme that i would want to set as a demo for people to try. I would like to have a menu that has options where one can set a color or option to test it.

Therefore, if somebody wants to check the blue scheme, they would click on "Colors->Blue" on the menu and the theme would turn to blue NOT GLOBALLY, but for the specific person, throughout the website.

I suppose it's pretty obvious that sessions are needed for this one, as well as some handling of GET parameters with a script that sets the color option of the theme(or any other option).

Since i am using the standard Wordpress API to set the theme options, i am wondering whether there is a way to hook an option. That is, instead of saving it to the dabatase, just pass it to the specific session, without having to change the code of my theme to adjust the option selection.

Has anybody done it ? Is there anything that can help me with that or i just need to do it from scratch ?

Thank you for your time !

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

What exactly and better will be is to submit the dropdown and check which color is submitted. Based on that particular color chose your css file. e.g. you create 3 css files named as blue-bg.css, green-bg.css and black-bg.css

then just put the related colors in those css files. e.g.

body {
  background-color: blue;       // same code but change the color for all files
}

Then in your header file you can check the posted value of the dropdown and load the css file based on the condition you submitted.

Hope it helps you out.

Regards

share|improve this answer
    
hmm, yeah i like that idea, instead of saving the value, just show the css file. Nice thanx –  SpyrosP Nov 30 '11 at 5:47
    
@ SyrosP: you are welcome... This is more productive you know. –  booota Nov 30 '11 at 7:49
add comment

Your Answer

 
discard

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.