A child theme allows you to change small aspects of your site’s appearance yet still preserve your theme’s look and functionality. 

How to Create a Child Theme #

1. Create a child theme folder #1. Create a child theme folder

First, create a new folder in your themes directory, located at wp-content/themes.

The directory needs a name. It’s best practice to give a child theme the same name as the parent, but with -child appended to the end. For example, if you were making a child theme of twentyfifteen, then the directory would be named twentyfifteen-child.

2. Create a stylesheet: style.css #2. Create a stylesheet: style.css

Next, you’ll need to create a stylesheet file named style.css, which will contain all of the CSS rules and declarations that control the look of your theme. Your stylesheet must contain the below required header comment at the very top of the file. This tells WordPress basic info about the theme, including the fact that it is a child theme with a particular parent.

1

2

3

4

5

6

7

8

9

10

11

12

13

/*

 Theme Name:   Twenty Fifteen Child

 Theme URI:    http://example.com/twenty-fifteen-child/

 Description:  Twenty Fifteen Child Theme

 Author:       John Doe

 Author URI:   http://example.com

 Template:     twentyfifteen

 Version:      1.0.0

 License:      GNU General Public License v2 or later

 License URI:  http://www.gnu.org/licenses/gpl-2.0.html

 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready

 Text Domain:  twentyfifteenchild

*/

Expand full source code

The following information is required:

  • Theme Name – needs to be unique to your theme
  • Template – the name of the parent theme directory. The parent theme in our example is the Twenty Fifteen theme, so the Template will be twentyfifteen. You may be working with a different theme, so adjust accordingly.

Add remaining information as applicable. The only required child theme file is style.css, but functions.php is necessary to enqueue styles correctly (below).

3. Enqueue stylesheet #

4. Install child theme #

5. Activate child theme #

Adding Template Files #

 

More at: https://developer.wordpress.org/themes/advanced-topics/child-themes/