How To Create A WordPress Child Theme
It is very simple, a child theme consists of two things:
1) A new folder in your /wp-content/themes folder on your server – you can name it anything you like
2) A style.css file in that folder with a few lines of code to connect it to the parent theme.
The WordPress.org Codex has a guide on creating a WordPress child theme and the basic code that goes into it.
There are two really important parts here:
1) The template line which tells WordPress which the parent theme is. Make sure to name this the way the FOLDER on the server is named, not the theme itself. The theme may be title Pixcel (uppercase P), but on the server, the folder is “pixcel” (lower case p) so that’s how you would need to reference it in the “template” line of style.css
2) The import line is important to bring in all the parent styles automatically. After that you just add the code for the changes you want to make in your child theme style.css.
If you need to change one of the php files in your parent theme, you will need to copy that file into the child theme folder and then change it. Any file that exists in the child theme takes precedence over the same file in the parent theme. The exception is functions.php which gets loaded in addition to the parent theme’s functions.php.
We always recommend to use aWordPress Child Theme when you need the functionality, features of a powerful parent theme without writing much code for it yourself. I hope this blog post help you understand bit about WordPress child theme. Let us know if you need any more help.
