Child themes are very popular these days. We will create a simple child theme for the Twenty Sixteen, one of the main standard WordPress themes.
To get started we will create a folder and we will name it twentysixteen-child . Then we will create a style.css inside this folder.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
/* Theme Name: Twenty Sixteen Child Theme Description: Simple child theme for the twentysixteen wordpress theme Template: twentysixteen Version: 1.0.0 Text Domain: twenty-sixteen-child */ @import url("../twentysixteen/style.css"); /* * Your custom CSS code here */ |
Just zip and upload your newly created child them. This should be enough to enable child theme editing. An alternative way to do it is to create a function.php inside the same folder that enqueues the main theme style.css just like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php /* * Include parent theme styles */ function enqueue_twentysixteen_style() { wp_enqueue_style( 'twentysixteen_style', get_template_directory_uri().'/style.css' ); } add_action('wp_enqueue_scripts', 'enqueue_twentysixteen_style'); /* * Your custom functions and hooks here */ |
By doing this you don’t have to do the @import in the CSS file. Just for the sake of appearance, you can also include a sceenshot.png file inside your folder before uploading it.
Simple as that, enjoy.