26 October 2023

in Drupal 7, you can achieve the goal of applying a different theme to anonymous users using Role Theme Switcher module. "Role Theme Switcher" allows you to set different themes for different user roles, including anonymous users.


Role Theme Switcher:

  1. Install and enable the "Role Theme Switcher" module.
  2. Go to the module's configuration page by navigating to "Configuration" > "User Interface" > "Role Theme Switcher" in your Drupal admin panel.
  3. Create a rule that specifies the conditions for anonymous users. For example, set the "Role" condition to "Anonymous user" and choose the theme you want to apply.
  4. Save your settings.
  5. Clear the cache.
Source code viewer
  1. drush dl role_theme_switcher
  2. drush en role_theme_switcher
Programming Language: Bash