miriamdepaula

WordPress: Theme Switcher by a period of the year

Dec 28th, 2011
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. add_filter('template','date_switch_theme');
  2. function date_switch_theme($theme) {
  3.        $month = date('n');
  4.        if ($month >= 1 && $month <= 4) return 'themename-1';
  5.        if ($month >= 5 && $month <= 8) return 'themename-2';
  6.        if ($month >= 9 && $month <= 12) return 'themename-3';
  7.        return $theme; // shouldn't happen
  8. }
  9.  
  10. //este código é apenas um teste para trocar o tema a cada 4 meses.
Advertisement
Add Comment
Please, Sign In to add comment