What is a child theme and how can you create one? A child theme is a theme template in which you can make modifications to scripts without affecting the scripts of the main (parent) template. Technically, you upload a theme template to WordPress according to your preferences, and then create a child theme, or a derived version of it, using a plugin, for example.
Then, you set the child theme as the primary theme in WordPress.
The great advantage of this approach is that whenever you make manual code changes to the scripts of the derived theme, these modifications won’t disappear with each update of the main template. Why? Because only the parent template will be updated, not its child version, where the appearance modifications will be safely preserved from being overwritten. Thus, they will always be preserved during updates.
Table of content
What is a child theme and how can you create one?
To simplify the process, we can create a child theme using a plugin. The plugin creates a derived template and also creates these 5 separate files:
Whenever a developer releases a new version of the parent theme, these files will only be overwritten in the parent theme, not in the child theme. Any modifications you’ve made to the appearance and code will remain untouched in their original form.
So, you don’t have to worry that with each update, you’ll have to do the same thing over and over again if you’ve changed the source code of the child theme. Thanks to this process, the code modifications will always remain in place.
How to create a child theme using a plugin
There are two ways to create a child theme, manually or using a plugin. Personally, I choose the plugin route for one simple reason. Once the plugin creates the child theme, you can delete it again so that it doesn’t unnecessarily take up space in the system. The child theme will remain in the system even after the plugin is uninstalled. The plugin does its job quickly, creates the template, and after uninstalling the plugin, it doesn’t take up any memory on the shared web hosting. Therefore, I don’t see any positives in creating the template manually, although this option does exist.
Plugin Child Theme Creator by Orbisius.
Personally, I have gotten used to using the Child Theme Creator plugin by Orbisius for these purposes. Installing the plugin is very easy, from the administration environment.
- In the left administration menu, click on “Plugins“.
- In the submenu of this group, click on “Add new“.
- Type the name of the plugin into the search field.
- Once the search displays the plugin, click on the “Install” button.
How to use the plugin
After installing the plugin, you can find it in the Appearance section of the left menu. Click on the “Creator” item (not the editor).
Now, select the template for which you want to create a child version, leave the “Create index.html placeholder to prevent file listing in child theme directory” checkbox checked, and click on “Create Child Theme“.
If you want to have your own details for the template in the system, such as description, name, version, etc., also check “Customize title, description etc.” before creating.
After clicking the button to create a child template, it is created almost instantly, and you can set it as primary and start using it, or even modify it. As mentioned above, if the plugin is no longer needed and is just taking up space in the list (e.g. if you are not using the code editor), you can uninstall it. This will not affect the created template in any way.
More content about WordPress
Je mi líto, že pro Vás nebyl článek užitečný.
Jak mohu vylepšit článek?
Řekněte mi, jak jej mohu zlepšit.