Drupal7: How to create sub-theme using existing theme.

Once again i came up with very basic stuff about the drupal 7. How to create sub-theme using existing theme in drupal 7 or you can say create sub theme in 4 quick and easy steps. Lets not wait for those steps.

4 quick and easy steps:

Step 1:
Lets say download the populer them from drupal i.e. zen
unzip zen content into following location “/var/www/drupal/sites/all/themes/zen”. change path as per project name

Step 2:
Now create folder “myzen” inside “/var/www/drupal/sites/all/themes/” folder and copy the STARTERKIT folder from “zen” folder inside “myzen” folder.
– Within this folder, rename the file STARTERKIT.info.txt to myzen.info

Step 3:
– Open the .info file in an editor
– Update the description field to “My custom Zen sub-theme”.
Save and exit this file.

Step 4:
– Open template.php in an editor and replace all occurrences of STARTERKIT_ with myzen_ using the editor’s find and replace all function.
Save and exit this file.

– Repeat the find and replace operation for the file theme-settings.php as well.
Save and exit this file.

Visiting the theme administration page at admin/appearance (Home | Administration | Appearance).
It should now display our new theme. Screenshots, favicons, and other niceties can be configured just like for any other theme.

Share this nice post: