How to create a child theme.
- Create a new folder for the child theme in the themes folder. Name it the same as its parentexcept add: -child at the end.
- Add a .css file called style.css
- Paste this code into the .css (except updated to correct template name):
/*Theme Name: Twenty Seventeen ChildTheme
URI: http://example.com/twenty-seventeen-child/
Description: Your first child theme!
Author: John DoeAuthor
URI: http://example.com
Template: twentyseventeenVersion: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: child themeText
Domain: twenty-seventeen-child*/ - Next add a functions.php file to the same directory as the .css.
- Paste this code into the .php:
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}