Displaying a different theme for each day of the week drupal

Days

<?php

/**
 * Implements hook_custom_theme().
 */
function mymodule_custom_theme() {
  // An array of themes for each day of the week.
  // These themes have to be installed and enabled.
  $themes = array();
  $themes[0] = 'monday_theme';
  $themes[1] = 'tuesday_theme';
  ..

  // Get the current day of the week in numerical form.
  $day = date("w");

  // Override current theme based on day of the week.
  return $themes[$day];
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s