If you are a WordPress developer or interested in WordPress, you may have heard the terms child and parent theme. Have you ever wondered what they mean and whether they could be beneficial to you? Read on to learn what is a child theme, its advantages, disadvantages, and more.

The definition of WordPress child theme

According to WordPress Theme Handbook, a child theme lets you ‘change small aspects of your site’s appearance yet still preserve your theme’s look and functionality’. In other words, a child theme is mostly about customizing the style. Parent themes are more about functionality. When you begin designing a child theme, it inherits everything from the parent theme. But then you can customize everything you want. Most importantly, you can update it and not lose any of the customizations.

Often, parent themes are WordPress frameworks. So, are parent themes frameworks? Some, yes. But remember that while all frameworks are parent themes, not all parent themes are frameworks. Not sure what frameworks are? Learn more about WordPress frameworks here.

Advantages of using child themes in WordPress

One of the main reasons for using child themes is that it speeds up development. Good parent themes, or frameworks, give developers many customization options that they do not have to code. Also, it is fairly easy to create a child theme: often, you might only need to create a new folder with a new style.css file. Some people recommend starting creating child themes instead of custom themes.

Another super important thing is that you can update parent themes and not lose the customizations in the child theme. WordPress themes have to be updated so that they are as secure as possible. No one wants possible security exploit, right? You update the parent theme and so functionalities and yet keep all customizations in the child theme. It makes things much easier and allows to save a lot of time.

Disadvantages of child themes

Although child themes can be super beneficial, they also have some disadvantages. First of all, you have to invest some time into learning the parent theme or framework. And the learning curve can be fairly steep. There are many hooks and filters, and you should know them all to make the most of the parent theme. But this is a one-time thing. You might take a bit longer to create your first child themes, but it will become very fast afterward.

There might also be the danger that the developers of the parent theme might abandon it or change it in a way you do not like. But it sounds worse than it is since most good themes are open source. So you can continue using them even if the developers abandon them. If they remove a feature you like, you can still add it because you have the code. If they make changes you dislike, just do not update! It is as simple as that. 

 

When should you use a child theme?

There are right and wrong occasions for everything. Child themes are great, but sometimes you might want to create a custom theme instead. Custom themes are better when you plan to customize a lot, not just the style and a few other files. If you develop a custom theme, you will not have to deal with issues like deprecated code later. 

Also, if you only plan to modify a few style elements, it might be enough to add a custom CSS plugin. If you want to change a lot of things, a child theme would be better. 

The bottom line is, if you are often adding new functions or modifying style, it is good to use a child theme. But if you need to customize a lot and more than just style and a few functions, consider creating a custom theme.

When creating a child theme, it is essential to choose a good parent theme. You should not customize too many things: if you plan to customize a lot, better to create a custom theme. Child themes should save your time.

Grandchild themes

Theoretically, you can also create grandchild themes. It would happen if you specified a child theme as the parent theme for another child theme. 

However, this is not recommended, at all. First of all, this is considered a very bad practice: if you need a grandchild theme, you should rethink your course of action. Secondly, you will likely run into issues. We do not recommend creating grandchild themes.

In conclusion, child themes speed up the development process. They allow you to customize style while keeping the functionality of a parent theme. And you can update without losing any of the customizations. Child themes are good when you plan to modify the style a lot but not too many functions: in that case, a custom theme could be better.

Perhaps you are also interested in MVC and FLUX patterns? Learn more about them here!