WordPress theming: create a child of an existing theme

A common away to create a theme for WordPress is to browse for an existing theme, install it, and customize it.
However, to create your own version of a theme, it’s better to create a child of the original theme (and then start customizing that).
Learn more on creating a child theme here.
Advantage of doing it this way is that you do not have to worry about automatic updates which might overwrite your theme/changes.
Also, the stylesheet of the child-theme only has to contain things which are different from the original (since the child stylesheet overrules the original).
Which makes it a lot easier and you only have to care about things which are different from the original.

You can use the Plugin “Child Theme Configurator” to create a child theme, or do it manually (explained at the bottom of this post).

Create a child theme with the “Child Theme Configurator”

child_theme_configurator

  • In the Dashboard, go to Plugins, then press “Add new”. Search for “Child Theme Configurator” by Lilaea Media and install and activate that plugin.
  • Next, go to Tools > Child Themes. At “Select a Parent Theme” select the theme you want to use as a base. Press “Analyse”. If you get no errors or warnings, the base theme is OK to use.
  • At step 7, if you want, you may customize the Child Theme Name and the Author. Leave all other options as they are (unless you know what you’re doing).
  • Press “Create New Child Theme” at the bottom to create the child theme.

If the child theme was generated successfully, you can use the link “Preview your child theme” to check it (it will still look the same as the original). After you activate the new theme, you can start to customize it. You can also edit the Stylesheet via the Dashboard: via Appearance > Editor. If you prefer to edit the Stylesheet on your computer, you can download it. It is in the folder wp-content\themes\<Child Theme Name>.

When your theme is ready, you can create a screenshot.png file with a screenshot of your theme and then activate the theme from the Dashboard.

Basic steps to create a child theme manually

  • Go to the folder wp-content/themes and create a new folder for your theme (all lower-case and do not use spaces!).
  • Inside the new folder, create two files: a stylesheet with the name style.css, and a php-file with the name functions.php. Both files must have some specific content as shown in the example.

When your theme is ready, you can create a screenshot.png file with a screenshot of your theme and then activate the theme from the Dashboard.

Read more on theme customization here.