[Drupal] How to set a default theme for each site in a Drupal multisite installation?

| | 1 min read

When we have a multi site Drupal installation, we might have to set a default theme for each site. The easiest way of setting a default theme for each Drupal site is by setting the theme from the settings.php file. If you are having a Drupal multistie installation and want to know how to set a default theme for each site in a Drupal multisite installation the continue reading.

Follow the steps below.

  • Open the settings.php file which can be found inside the /sites folder
  • Scroll down to the Variable Overrides section.
  • Under that locate the section mentioned below
    # $conf = array(
    #   'site_name' => 'My Drupal site',
    #   'theme_default' => 'minnelli',
    #   'anonymous' => 'Visitor',
  • Uncomment the required line and add the name of the theme in the theme_default line.
  • Finally the settings.php file should look like the one shown below
     $conf = array(
    #   'site_name' => 'My Drupal site',
       'theme_default' => 'name_of_theme',
    #   'anonymous' => 'Visitor',
  • Remember to uncomment the line which has the closing bracket of the $conf array.
  • Also take care to flush all caches

If all the above steps are followed correctly the site will default to the corresponding theme when it is accessed. If you are facing any other issues in your Drupal multisite installation use the comments form below.