As I mentioned in the introduction to this article, sometimes you need to customize Israel Email List your theme a little more and not lose the changes with each update. To explain myself better, I am going to give you an example of a very common case. Imagine that you want to add the Google Analytics code to the header of your WordPress . Also, you are not going to use any plugin just for that because you want to save as much as possible the resource consumption of your web hosting . You are going to insert it directly in the header. You open header.php and paste it between the corresponding tags or add it with a function from the functions.php of the theme that is active. For a while, nothing happens. The theme is updated and you continue working normally. Some time later, you enter the Google Analytics panel and see that statistics are missing for several days. What happened? Very simple: when a main theme is updated, its files are overwritten .
All the modifications you make are deleted . You could Israel Email List create a guide document with all the changes and add the code in each file after each theme update, but it is cumbersome, time-consuming and not feasible. This is what a child theme is usually used for . A child theme is not updated, it is not overwritten. It only inherits the functionalities of the parent theme. You can make 20,000 changes and you will never lose them. It is the ideal solution for these cases. My recommendation is that you create a child theme from the first moment you start working with your website. If in your case you already have a WordPress but you have not created a child theme, now is that time! Read on because I’m going to teach you how to create a child theme in several different ways. How to create a child theme in WordPress Now that you know what a child theme is and what it is for, the next step is to create it. It is important that you have FTP access to the files on your site in order to do so.
There are several ways to create a child theme: from scratch or with a plugin. How to create a child theme in WordPress from scratch How to create a child theme from scratch – This is the method that is normally used . Access by FTP or through the file manager to your website. In the WordPress file structure you will see that there is a folder called wp-content . The themes Israel Email List you have installed are stored there (whether they are activated or not). Decide which theme you want to create a child theme for. The normal thing is that it is the topic that you have active at the moment. In my case, I’m going to create a Twenty Seventeen child theme. Locate the theme folder inside wp-content / themes . Now, create a new folder (which is where you are going to put the files) and name it like this: nametheme -child , where “ nametheme ” is the name of the folder of the theme you want to create the child theme for .