If you plan on editing the files of your theme, then it’s highly recommended that you create a child theme. Otherwise, all the modifications that you have done to the theme files will be canceled when you update the theme. Here’s how to create a child theme:
- Go to /wp-content/themes/ and create a new directory whose name should be the name of the parent theme plus “-child”. For example, if you want to make a child theme for the Camilla theme, then the name of the child theme directory should be “camilla-child”.
- Now go to the directory of the parent theme and copy the style.css file and paste it in the child theme directory. You need to change the “Theme Name” line to something unique, adding the word “Child” at the end should be okay (e.g. “Camilla Child”, instead of “Camilla”, in case you’re using the Camilla theme). And you also need to add a new line called “Template: camilla” (this is a case-sensitive line, which means that “camilla” and “Camilla” are not the same). If you don’t use the Camilla theme, then replace “camilla” with the name of your parent theme directory (the parent theme is the theme on which is based the child theme that you’re currently creating). Here’s an example of how the style.css file should look like for a child theme of Camilla:
- Lastly, go to Appearance > Themes and activate the child theme that you’ve just created.
Theme Name: Camilla Child
Theme URI: http://themevillage.net
Author URI: http://themevillage.net
Description: Camilla is a modern, minimal, horizontal canvas to display your Photography work in!
Text Domain: camilla
Domain Path: /languages/
Tags: responsive-layout, two-columns, black, white
License: GNU General Public License version 3.0 & Envato Regular/Extended License
License URI: http://www.gnu.org/licenses/gpl-3.0.html & http://themeforest.net/licenses
All PHP code is released under the GNU General Public Licence version 3.0
All done. Now, whenever you want to edit a theme file, all you need to do is to copy that file and paste it inside the child theme directory and modify it there, and you will be able to update the parent theme without worrying that it will cancel the changes you’ve made. You can read more about child themes here: https://codex.wordpress.org/Child_Themes or here: http://code.tutsplus.com/tutorials/child-themes-basics-and-creating-child-themes-in-wordpress–wp-27475