What is a child theme and how can you create one in WordPress?

Last updated December 6th, 2023 06:21

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.

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:

  • index.php
  • header.php
  • footer.php
  • style.css
  • function.php

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.

What is a child theme and how can you create one in WordPress?
co je to child template
co je to child template

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.

co je to child template

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).

co je to child template

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.

co je to child template
co je to child template

Conclusion

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

Whole category is here

The website is created with care for the included information. I strive to provide high-quality and useful content that helps or inspires others. If you are satisfied with my work and would like to support me, you can do so through simple options.

Byl pro Vás tento článek užitečný?

Klikni na počet hvězd pro hlasování.

Průměrné hodnocení. 0 / 5. Počet hlasování: 0

Zatím nehodnoceno! Buďte první

Jak užitečný vidíte tento článek.

Sledujte mě na sociálních médiích.

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.

newsletter

Subscribe to the Newsletter

Stay informed! Join our newsletter subscription and be the first to receive the latest information directly to your email inbox. Follow updates, exclusive events, and inspiring content, all delivered straight to your email.

Odebírat
Upozornit na
guest
0 Komentáře/ů
Vložené zpětné vazby.
Zobrazit všechny komentáře.

Pokud mi chcete napsat rychlou zprávu, využije, prosím, níže uvedený
kontaktní formulář. Děkuji.

Další Kontaktní údaje