Creating a theme from scratch
While we have previously looked at installing contributed themes and extending base themes using sub-themes, this recipe will outline the steps required to create a custom theme.
Getting ready
It is assumed that the sites/all/themes
folder has already been created. This is the recommended location to place custom and contributed themes.
How to do it...
Creating a brand new custom theme is not unlike what we did in Chapter 2, Beyond the Basics, in creating a sub-theme for a core theme. The main difference is that there is no base theme and that files such as page.tpl.php
will need to be explicitly defined.
Create a folder with the new theme's name inside the
sites/all/themes
folder. In this example, we are going to call our thememytheme
.Create a file named
mytheme.info
and open it in an editor.Add details about the theme as follows:
name = My theme description = My custom theme core = 6.x engine = phptemplate
Save the file.
Visit the theme administration page at
admin...