Programmatically Switch Themes
Permalink
I'm interested in having a day and a night theme depending on the server time. I don't even know where to start, but I figured it would be nice to have separate themes for ease of editing etc. I'm pretty sure I could do it with php within a single theme, but was interested to know if anyone else has had success programmatically switching themes.
Just in case anyone else wants to do this.. I decided it would be much simplier to just create an additional "night" css file that changes the graphics etc and embed it into the existing theme.
Here is the code I used..
My site is local community based, so I am simply using the servers time, you may need additional code to use the visitors time.
Here is the code I used..
My site is local community based, so I am simply using the servers time, you may need additional code to use the visitors time.
so $hourTime
if($hourTime < $morning || $hourTime > $night){
night time int css include
}else{
day code
}