Last updated September 25, 2015. Created on June 17, 2013.
Edited by Amber Himes Matz, Christopher James Francis Rodgers, davidneedham, JohnAlbin. Log in to edit this page.

The base Zen theme is designed to be easily extended by its sub-themes. You shouldn't modify any of the CSS or PHP files in the zen/ folder; but instead you should create a sub-theme of zen which is located in a folder outside of the root zen/ folder. The examples below assume zen and your sub-theme will be installed in sites/all/themes/, but any valid theme directory is acceptable (read the sites/default/default.settings.php for more info.)

IMPORTANT NOTE: In Drupal 7, the theme system caches which template files and which theme functions should be called. This means that if you add a new theme, preprocess or process function to your template.php file or add a new template (.tpl.php) file to your sub-theme, you will need to rebuild the "theme registry." See

Drupal 7 also stores a cache of the data in .info files. If you modify any lines in your sub-theme's .info file, you MUST refresh Drupal 7's cache by simply visiting the Appearance page at admin/appearance.

This documentation is specifically for people who use Drush. You can take advantage of the drush zen command to automatically generate a sub-theme.

  1. Ensure drush knows about the zen command

    After you have downloaded Zen and placed it in your sites/all/themes directory, you need to enable the Zen theme and set Zen as the default theme on the Appearance administrative page. Type: drush en zen and go to Administrative Menu > Appearance and next to Zen, click on Set default. The drush zen command will now be available to run.

  2. Run the drush zen command with the following parameters.

    In the command line, use the drush zen "Foo theme" foo command to generate a subtheme with machine name foo and human name "Foo theme" in your Drupal site.

    Tip: Type drush help zen to view options and example commands.

    You may provide additional options to specify parts of your theme before it's created.

  3. Set your website's default theme.

    Log in as an administrator on your Drupal site, go to the Appearance page at admin/appearance and click the "Enable and set default" link next to your new sub-theme.

    Optional steps:

  4. Modify the markup in Zen core's template files.

    If you decide you want to modify any of the .tpl.php template files in the zen folder, copy them to your sub-theme's folder before making any changes. And then rebuild the theme registry.

    For example, copy zen/templates/page.tpl.php to foo/templates/page.tpl.php.

  5. Modify the markup in Drupal's search form.

    Copy the search-block-form.tpl.php template file from the modules/search/ folder and place it in your sub-theme's template folder. Don't forget to rebuild the theme registry.

    You can find a full list of Drupal templates that you can override in the templates/README.txt file or

    Why? In Drupal 7 theming, if you want to modify a template included by a module, you should copy the template file from the module's directory to your sub-theme's template directory and then rebuild the theme registry. See the Drupal 7 Theme Guide for more info.

  6. Further extend your sub-theme.

    Discover further ways to extend your sub-theme by reading Zen's documentation and Drupal 7's Theme Guide.

Here's the output of drush help zen:

Create a theme using Zen.

  Create a sub-theme, using the default options:
    drush zen "My theme name"
  Create a sub-theme with a specific machine name:
    drush zen "My theme name" my_theme
  Create a sub-theme in the specified directory without RTL stylesheets:
    drush zen "My theme" --without-rtl --path=sites/default/themes

name             A name for your theme.
machine_name     [optional] A machine-readable name for your theme.

--description    A description of your theme.
--machine-name   [a-z, 0-9] A machine-readable name for your theme.
--name           A name for your theme.
--path           The path where your theme will be created. Defaults to: sites/all/themes
--without-rtl    Remove all RTL stylesheets.

Looking for support? Visit the forums, or join #drupal-support in IRC.


pandaeskimo’s picture

I was having issues running 'drush zen ...' and this was solved by enabling the module AND setting it as the default. Otherwise the command did not think that zen was enabled.

namli’s picture

Yep, thanks a lot, for me it's work too!

euse’s picture


euse’s picture

Drush Version : 8.0-dev