Customizing a theme is one of the most frequent tasks WordPress developers get hired for. If you ever engaged with one of these professionals, there's a high chance you might have been asked whether you had a child theme or not.
Wait a second - you thought - I have a theme I bought from Themeforest. Is it a child theme? Did I buy the "wrong" WordPress theme, one that's not a child theme and now I'm stuck with this design?
I feel your pain. But I have the remedy to it.
What is a child theme in WordPress?
To better understand what a child theme is, let's start with the definition we get from the Codex which reads:
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
What does this tell you? It tells you that a child theme is a WordPress theme strictly connected to another theme, from which it inherits some aspects, namely its functionality and styling. It is, if you like, a special type of WordPress theme where something pertains to it and something else is derived from another theme which is working as a parent theme.
Be warned, though: even if its name might trick you, a child theme isn’t a stripped-down, less-powerful, or limited version of a theme. It’s more of an extension of your current WordPress theme. You’ll see what I mean in a second.
So what does that mean in plain English? Let me give you an example.
What is a WordPress child theme in plain English?
Imagine you have a painting on your wall. And, on top of it, you put a transparent foil for your kids to draw with pencils all over the place. They can make a house blue instead of the white one your painting has. They can add some trees and a flying dragon which were absent in your piece of art hanging on the wall. In short, they can modify how the original painting looks based on their latest tastes.
Your kids - or anyone you want - can keep drawing and modifying the painting without ruining it because all occurs on the transparent foil, which is something you can always remove
and revert back to your original (probably less appealing) painting.
A child theme works exactly like this. As WordPress developer and Codeable expert Daniel Klose explains:
A child theme is basically a layer on top of your existing WordPress theme that you can make modifications to. You can change part of its functionality, you can change its style, how it looks, all being sure you're not ruining your parent theme.
So now you have a child theme and a parent theme.
What is a child theme vs parent theme?
The parent theme is the theme we'll usually refer to when talking about WordPress themes. It's the main theme that provides and handles all the features, functionalities, and its style. A parent theme doesn't need a child theme to work, while the opposite isn't true.
A child theme, on the other hand, works as an additional layer on top of the parent theme. It allows your developer to tweak, add, remove an existing WordPress theme without worrying about losing your customizations. Child themes require a parent theme to properly work because they inherit part of their files.
Using child themes is the best practice when it comes to adding extra features or style to a WordPress theme. In fact, you should never edit directly:
- WordPress core files
- Plugin files
- Theme files, with the exception of starter themes which are a special kind of themes meant for theme developers
Top advantages of using a child theme in WordPress
Child themes offer a wide variety of benefits in terms of the changes that can easily be made to an existing theme. From minor alterations to major layout changes, an original theme can be altered without even the slightest impact on the performance of the original website.
It is always used when you are looking to tweak or customize an existing WordPress template, but worry that you may lose its custom and built-in style. To be honest, having a child theme created is the safest way to customize your WordPress theme.
Child themes bring you customizations without the fear of losing them
Let's say you bought a theme a year ago that you're still using on your WordPress site. It still looks fine to you but it should need a design refresher because you'd like it to be focused on conversions and currently it's simply a leaky pipe.
If you make edits directly in your header.php, function.php files, the next you'll update your theme with its latest version - and there are lots of important reasons to keep it up-to-date -, you'll lose all your customizations. All the changes you have done will get overwritten by the newer versions of those same files and you will lose what you have done.
This is where a child theme comes to rescue you.
After your developer created a child theme from your current WordPress theme (aka the parent theme), you'll be able to have them to implement any changes and customizations without the possibility to see them swiped away in the future.
This means you will never ruin the features, highlights, and functions of the original theme, for you actually don't modify the files.
Child themes allow customizations without slowing down your site
Another reason for using a child theme when modifying a WordPress theme is that it gives you peace of mind on the performance of your website while providing the customizations. By leveraging your WordPress theme's files, a child theme won't affect much the speed of your WordPress site. Daniel elaborates:
With a child theme, your developer has the opportunity to make very targeted and specific changes to the design of your theme without putting too much extra load on the website. That's possible because you don't need to add any additional plugin on top of your website to get the same results.
Limits of child themes
No feature or plugin can offer unlimited options, and every chunk of code comes with its respective limitations. Similarly, child themes also have their respective drawbacks and certain functions that they can’t perform.
Child themes give you the freedom to perform a limited amount of changes to your WordPress theme. If you want to perform a complete overhaul of the website, for example, or add complex new functionality, you will have to look elsewhere. Daniel points out:
Child themes are meant for small to medium alterations to an existing design theme. For example, moving a logo over or changing a small functionality. If you go too big with changes or if you want to create a new functionality that isn't part of your existing WordPress theme, you'd better go with a custom theme, which will be developed from scratch based on your needs.
Another thing worth noticing is that not all pre-built themes are good candidates to become a parent theme because it is a wrong call to have a child theme created from a WordPress theme which is already lacking key features you're looking for.
In this case, you've picked the wrong theme and you should choose a new one.
Child themes are a great way to make certain changes to the design and layout of an existing WordPress theme without affecting the functions or performance of the original theme. This makes it the ideal approach to small customizations and tweaks. As a result, the vast majority of pre-built WordPress themes available on platforms like ThemeForest ship with their child theme version as well. Daniel further points out:
Most of the time, when you buy pre-built themes on marketplaces, they not only provide you with the child theme but they recommend in the documentation to install the child theme and work on it as well.
Why are child themes such an important asset in WordPress custom development, then? Because it's more effective to leverage this extra functionality to implement edits to your theme, and it prevents you from losing customizations you've spent resources on.
Daniel Klose is a Tech-Wiz, Blogger and Industry Professional. Born and raised in Germany, he quickly discovered his passion for all things digital. As a full-stack developer he now supports small and medium-sized businesses in their digital endeavors, with a focus on scalability.