WordPress child themes are a great way to tweak or completely change a theme and best of all they are very easy to create. In this tutorial i will create a child theme of the stock twenty fifteen WordPress theme.
For a theme to be child theme of any parent theme it has to have it’s own folder and at minimum it need only one file in it which is the style.css file.
The style.css file is the main entry point for WordPress to be able to create a parent child relationship between two themes.
The style.css file must import the styles of the parent theme. It does that with the following code as it’s first line
The next few links of code have to be added as comments and are pretty self explanatory.
Theme Name: twentyfifteen child
Theme URI: URI to your theme on the web if u have any.
Tags: two-columns, right-sidebar, custom-header, custom-colors, custom-background, custom-menu, theme-options, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style
And that’s it now you can add custom CSS code to this child theme’s style.css file and that CSS code will override the parent theme css code.
And not only that any file can now be overridden after copying to the child theme’s folder.