Create a sibbling folder near for parent theme. For example we have parent theme Twenty Fifteen Child. Create a folder twenty-fifteen-child with style.css file in it. It should consist:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/* 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: twenty-fifteen-child */ // If we want a parent styles in our child theme @import url("../twentyfifteen/style.css"); |
You will need to replace the example text with the details relevant to your theme.
The Template line corresponds to the directory name of the parent theme. 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.
The only required child theme file is style.css, but functions.php is necessary to enqueue styles correctly (below).
1 2 3 4 5 6 |
<?php function my_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); |
More details https://codex.wordpress.org/Child_Themes.