I tried drush disable theme-name
and afterwards drush enable theme-name
, but it didn't work.
How do you change theme with Drush?
Commands to be used in theme using drush :
theme-enable => pm-enable
theme-disable => pm-disable
theme-info => pm-info
theme-list => pm-list --type=theme
theme-list-enabled => pm-list --type=theme --status=enabled
theme-set-default => vset theme_default
theme-set-admin => vset admin_theme
theme-status => status theme
drush vset theme_default THEMENAME
and because I had errors relating to my theme not being active, I couldn't access the set default through the admin pages (article I read here: pixelthis.gr/blog/drush-enable-theme-and-set-default)
For Drush 9.5.2 and Drupal 8.6.5 I use the following:
drush theme:uninstall THEME_MACHINE_NAME
drush theme:enable THEME_MACHINE_NAME
drush config-set system.theme default THEME_MACHINE_NAME
drush config-set system.theme admin THEME_MACHINE_NAME
Commented
Sep 4, 2021 at 20:35
With Drush 7 and 8, it is no longer necessary to be so verbose. If you want to enable a theme use the alias:
drush en your-theme-name
drush dis your-theme-name
For example:
drush en seven
drush dis bartik
You may want to clear your caches after enabling or disabling themes. For more information please see: DrushCommands.com
drush config-set system.theme default NAME_OF_YOUR_THEME
Commented
Oct 3, 2017 at 11:04
If you want to change the admin theme using Drush, you can use below command.
drush config-set system.theme admin <theme_machine_name>
Eg.
drush config-set system.theme admin seven
If the theme is not installed, first install the theme using below command
drush theme:en seven
Again run the above command to set admin theme.
drush dis
and drush disable
aren't anymore valid, in Drupal 8. Their Drupal 8 equivalent are the following commands.
drush pm-uninstall THEME_MACHINE_NAME
drush pm-uninstall MODULE_MACHINE_NAME