Creating a Zen Sub-theme

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Often the best way to learn a system is to take an existing example and modify it to see how it works. One big disadvantage of this learning method is that if you break something and the original example worked before you hacked it, there’s very little incentive for others to help you.

Drupal’s theming system has a solution to this problem: parent themes and sub-themes. A “sub-theme” will inherit all its HTML markup, CSS, and PHP code from its parent theme (called a “base theme”.) And with Drupal themes, it’s easy for a sub-theme to override just the parts of the parent theme it wants to modify.

A “starter theme” is a sub-theme designed specifically to be a good starting point for developing a custom theme for your website. It is usually paired with a base theme.

Detailed instructions on how to create a Zen sub-theme are available for each major version of Zen.

How do you create a theme with Zen?

A quick overview of which files you will need

Make a 7.x-6.x sub-theme

Creating a sub-theme with or without the command line

Make a 7.x-5.x sub-theme automatically with Drush

Creating a sub-theme using the command line

Make a 7.x-5.x sub-theme manually

Creating a sub-theme without using the command line

Make a 7.x-3.x sub-theme manually

Creating a sub-theme without using the command line

Make a 7.x-3.x sub-theme with Zenophile

Creating a sub-theme using the Zenophile module

Guide maintainers

johnalbin's picture