[wp-hackers] Switching theme depending time of the year

Aaron Jorbin aaron at jorb.in
Wed Dec 28 04:17:17 UTC 2011


All those If statements seems a bit overkill to me.  I would
filter template and stylesheet.  Take a look at
http://plugins.svn.wordpress.org/theme-switcher/trunk/theme-switcher.php

Unless you intend to show different content (not just a different
presentation), I would encourage you to make your changes via the
stylesheet.


http://aaron.jorb.in
twitter: twitter.com/aaronjorbin


On Tue, Dec 27, 2011 at 11:00 PM, Daniel Fenn <danielx386 at gmail.com> wrote:

> Hello Aaron,
>
> Thankyou for pointing out that that I could just change the style
> sheet with the date function and the wp enqueue style function.
>
> If I really wanted to, could I do a if, else in every theme file and
> have it say if date is between 8th of Dec and 7 of Jan include this
> file else show other content? Would that work?
>
> Thankyou :)
>
> On 28/12/2011, Aaron Jorbin <aaron at jorb.in> wrote:
> > Instead of different themes, I would reccomend (since switching themes
> > is guaranteed to not requiring setting up options or be user action
> > free) enqueueing[1] different stylesheets based on the php function
> date[2].
> >
> > 1) http://codex.wordpress.org/Function_Reference/wp_enqueue_style
> > 2) http://us.php.net/manual/en/function.date.php
> >
> > http://aaron.jorb.in
> > twitter: twitter.com/aaronjorbin
> >
> >
> > On Tue, Dec 27, 2011 at 10:42 PM, Daniel Fenn <danielx386 at gmail.com>
> wrote:
> >
> >> Hello all,
> >>
> >> Bit late but merry xmas and happy new year to you all.
> >>
> >> I would like to know if there any way that I can have say 3 themes
> >> installed on a wordpress blog and have a script that will change the
> >> theme used depending on what time of the year it is or even down to
> >> what day it is. Does anyone know how I can do that?
> >>
> >> Thankyou :)
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
> --
> Regards,
> Daniel Fenn
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list