How to create a child theme

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:

  1. 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”.
  2. 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:
  3. Lastly, go to Appearance > Themes and activate the child theme that you’ve just created.

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