WordPress has many awesome themes. Before you dive into them, you’d better think about long-term effects. Here is a scenario. Someday, a new and improved version of the theme you are going to use on your site is released by the person who created it. Here is the issue: if you update the theme with the new version, you wipe out all the edits and changes you made to your old version theme. Then you have to edit it over and over again whenever a new version of the theme is released.
Fortunately, WordPress provides a solution. WordPress has an amazing theme-development technique known as child themes. When you create a child theme, your current theme (or “parent” theme) will be regarded as a starting point. Your edits and changes in your child theme can override the styling of your current theme. In this way, when you install an update for your current theme, your altered files in the child theme folder will remain unchanged.
You’d better start by creating a child theme if you wan to customize your theme. However, if you want to create a completely new theme on your own, then you don’t need to bother to create a child theme.
To create a child theme, you just simply create a folder (name the folder whatever you want) in your wp-content/themes
directory. Then create a single style.css
file within that folder.
For example, if your current theme is Twenty Fourteen, then place the following codes in your style.css file you just created in your child theme.
/*
Theme Name: child theme of Twenty Fourteen
Description: This is a customized version of the Twenty Fourteen
Author: your name
Template: Twenty Fourteen
(optional values you can add: Theme URI, Author URI, Version)
*/
@import url("../twentyfourteen/style.css");
The most important line is the “Template: Twenty Fourteen” line, because it indicates the folder of the parent theme. The last line imports the stylesheet from your parent theme.