A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
Why use a Child Theme?
There are a few reasons why you would want to use a child theme:
- If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.
- Using a child theme can speed up development time.
- Using a child theme is a great way to learn about WordPress theme development.
How to Create a Child Theme
In this example, we will be creating a child theme for our Retina Blog WordPress theme. First things first, we need to create a new folder for your child theme. Naming it something like /retina-child/ is conventional. Within your new theme folder, create a file called style.css and fill in the information as outlined below. The theme Name, URI, Description and Author are totally up to you.
Theme Name: Retina Blog Child Theme
Theme URI: https://www.yourdomainname.com/
Description: Retina Blog Child Theme
Author: Thememattic Inc
Author URI: https://www.yourdomainname.com/
Template: Retina Blog
/* =Theme customization starts here
Note: You must ensure that the “Template:” parameter correctly identifies the name of your parent theme. If you are using a different theme, then adjust the values accordingly.