Displaying a different theme for each day of the week

Public

Warning message

We recommend you to assign at least one category to this snippet so you could easily navigate it in the future. Edit your snippet here.
</> CopyGet raw version
php
  1. <?php
  2.  
  3. /**
  4.  * Implements hook_custom_theme().
  5.  */
  6. function mymodule_custom_theme() {
  7. // An array of themes for each day of the week.
  8. // These themes have to be installed and enabled.
  9. $themes = array();
  10. $themes[0] = 'monday_theme';
  11. $themes[1] = 'tuesday_theme';
  12. ..
  13.  
  14. // Get the current day of the week in numerical form.
  15. $day = date("w");
  16.  
  17. // Override current theme based on day of the week.
  18. return $themes[$day];
  19. }