What are child themes for WordPress, advantages, disadvantages and how to create them

Today, October 19, 2017, at 7:00 p.m. Spanish time, live and direct, we will talk about the child themes for WordPress, what they are, their advantages and disadvantages and how to create them.

What are child themes for WordPress?

WordPress always works with a parent theme, the main one, where all the files, styles and functionalities of our theme are collected. The child themes are those themes based on the parent theme (main) in which we can make modifications to our theme without the parent theme undergoing changes in its code, but in the final result of the appearance of our web page.

That is, in our child theme we can change the style and functionalities of our theme, these changes being in the child theme, those that have priority over the parent theme.

Advantages

The main advantage of using a child theme is to be able to make the modifications we need in our theme if we need to make those changes in the parent theme, since WordPress when detecting a child theme will always give priority to it.

A practical example, let’s say we are not using a child theme and we work with the original parent theme, making changes, styles, functionalities etc, and when a theme update arrives, we update and lose all the changes made.

If we have a child theme, that update of the parent theme will not affect the changes made in the child theme, since these will not be altered and despite the fact that the parent theme has been updated, the changes made, for example in style, or inclusion of additional code, they will not be lost, since they will remain intact in our child theme.

Disadvantages

Child themes can slightly affect the performance of our website, since it will load in addition to the parent theme files, additional files and changes to the child theme.

It can be a bit complex for novice users or no knowledge of code or programming or who do not know the structure and internal workings of WordPress themes.

How to create a child theme

A child theme can be basic or complex, it depends on the amount of changes we want to make in our WordPress.

A child theme basically consists of two files, the style.css file, where we mainly collect the data of our child theme, name, author, version, connection to the parent theme, which we want for our child theme.

And the file functions.php where we will indicate to our child theme, from where it should take the base CSS style of the parent, where it is indicated that the style of the child theme is the one that prevails over the parent theme.

In the child theme we can add more files, such as the header.php with the modifications we need and the footer.php also if we want to add additional code and that it prevails over the parent theme.

Basically we will create a folder with the name of our theme, for example parent-child themename and we will include inside the two basic files, style.css and functions.php.

We will upload this folder inside the themes folder of our WordPress and when we enter our WordPress administration, our child theme will appear in the themes section to activate or preview it as if it were a new theme and from there, start customizing our child theme, without affecting the parent theme.

At codex de WordPress You can get all the technical information, files and example codes to create your own child theme.

Many premium paid themes already include their own child theme so that you can start making changes, we recommend that if this is your case, you check the documentation of your theme provider.

In another order and as a novelty, we already have beta 3 of WordPress 4.9 available to test, which is expected to be released on November 14.

You can follow today’s program live in this post.

WordPress News in Spanish, every Tuesday and Thursday, at 7:00 p.m. live, with Antonio Postigo @hoystreaming and Pedro Santos @hostfusion

All the videos from previous programs are available in the WordPress News section in Spanish and also in our Podcast.

An original idea of Host-Fusion.Com your provider hosting para WordPress trustworthy and HoyStreaming.comYour digital window to the world.

20% discount on WordPress hosting at Host-Fusion.com