3

I started developing a custom drupal theme from scratch(http://www.codexworld.com/create-drupal-custom-theme-from-scratch/).

In appearance menu below disabled themes, there was a drop-down menu for admin theme with theme names and a checkbox. As a curious person when I set admin theme to my custom theme(i am developing) I was unable to see Website pages & the Drupal admin dashboard because theme is empty/under developement. How to get back the default admin theme?

Edit: After Using acrosman's answer(adding $conf['theme_default'] = 'bartik'; in settings.php) i can see pages but still unable to see admin panel because I am using that incomplete theme as admin theme

How to Manually change the admin theme in Drupal 7?

What I Found: drupal is a popular website cms but you can't change the admin theme very easily if you chosen a wrong theme as admin theme by mistake.

1
  • Don't reinstall Drupal. See my answer below.
    – Gulok
    Commented Jun 23, 2016 at 5:00

2 Answers 2

2

This is the easiest method to reset your admin theme in a Cpanel.

Update your settings.php to have:

// If your admin theme is Bartik.
$conf['admin_theme'] = 'bartik';

Warning with using $conf as you cannot set the theme via Appearance page anymore.

If you prefer SQL query method...

  1. Access PHPMyAdmin.
  2. Select the Drupal database and run this query.

UPDATE variable SET value='s:7:"garland"' WHERE name = 'admin_theme';

Where 7 is the total number of strings your theme has. Example, if your theme is adminimal. Then your query should be like this.

UPDATE variable SET value='s:9:"adminimal"' WHERE name = 'admin_theme';

Please see the documentation on Drupal.org.

Take note that if you are using Context module the $conf is not helpful as it will always respect the theme assigned via Context.

Hope this helps.

1

You can change the default theme on the command line with Drush:

drush vset theme_default theme_name

You can also override the default theme variable in settings.php by adding:

$conf['theme_default'] = 'bartik';

This will force the site to always use that theme until the line is removed from the settings file.

If everything has gone blank you may be having problems with your theme because you have a basic syntax error or other bug that's causing a white screen of death. That page has several suggestions about ways to make sure you're seeing your errors.

5
  • is there a drush installation guide where can i understand where to copy file "drush.phar" in file manager and where to execute the code drush vset theme_default theme_name thanks
    – proseosoc
    Commented Jun 22, 2016 at 20:55
  • Drush is a command line tool, so the guides assume you are on the command line: docs.drush.org/en/master/install As long as you are not in Windows the directions should work, there is a link to alternative install processes if you are on Windows
    – acrosman
    Commented Jun 22, 2016 at 20:59
  • i am using cpanel and there is no command line when i searched there
    – proseosoc
    Commented Jun 22, 2016 at 21:01
  • can you please tell me what is the icon or name of "command line" in cpanel
    – proseosoc
    Commented Jun 22, 2016 at 21:02
  • Cpanel may, or may not, let you have shell access depending on your host. You're looking for with SSH or Shell access. I updated my answer to provide another way to override the variable so you can get things up again.
    – acrosman
    Commented Jun 22, 2016 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.