You may have come across different WordPress sites and noticed their templates; you may have even seen some that look very similar but have different features or functionalities. The response as to why this happens could be one simple phrase: child themes.
You may be asking yourself, what is a WordPress child theme? And you are probably not alone. While the term gets thrown around a bit, we may want to explore what that actually means.
In this article, we will do our best to help you answer a variety of questions, including:
- What is a WordPress child theme?
- When should you create a child theme?
- Why do people use child themes?
- What are the advantages and disadvantages of a WordPress child theme?
Once we review all of this key information, you’ll be able to make the decision about whether or not you want to use a WordPress child theme yourself.
What is a WordPress Child Theme
The first section will answer the burning question: What is a WordPress child theme?
The answer is simple: a WordPress child theme is a theme that gets its primary functionality from another WordPress theme, known as the parent theme. Child themes are used on WordPress to customize an existing WordPress theme while retaining the ability to upgrade that theme later on.
The problem in the past was that WordPress themes weren’t easily updated without losing all of the hard work you put into customizations and styling for your theme. This was especially problematic when you discovered that there was a script in your theme that needed correcting, and your theme needed to be updated immediately.
It was a difficult decision— you’d either update and lose all of your custom styles and function, or not update and risk your site being hacked or compromised.
So, ultimately the answer to the question “what is a WordPress child theme?” is that a child theme is the solution to a previous problem— the WordPress child theme inherits all of the features, code, and functionality of the “parent” theme without actually altering the parent theme at all.
The idea of a child-parent WordPress theme structure is to protect the styling and customizations made to the theme without losing ability to update the parent theme easily. This concept and structuring can be applied to any WordPress theme.
What is a WordPress child theme in terms of its parent theme? It can only be as good as its parent theme, and the thing to keep in mind is that not all WordPress themes are good parent themes in the first place. If the parent theme is limited in terms of functionality and features, it’s not a good fit for a parent theme in the first place. We’ll discuss this later in our article.
When you have a good parent theme, you’ll be able to create a custom WordPress site with a child theme very rapidly; the theme framework should include its own action hooks and filters for optimal results.
Why do people use WordPress Child Themes?
Now that we can answer “what is a WordPress child theme?” Let's move onto our second question– why do people use WordPress child themes? You may have a few guesses from our info above, but let's check out some common reasons just to be sure.
In order to speed up development, it’s common that designers and developers adopt child themes; when a good parent theme is used, it’s easy to create a custom WordPress site and significantly reduce the amount of time it takes.
Parent themes, also known as theme frameworks, provide the child theme with heaps of customization options and functionality, that way you don’t have to code everything yourself to get it just how you want it. It’s a jumping off point.
It’s also common for users to create child themes in order to make changes or customizations to an existing theme and still be able to update that original parent theme without losing those changes, as we discussed above.
It can be very easy to create a WordPress child theme; it can even be as simple as creating the new style.css file and putting it in a new folder. You’ll have one line in the new style.css header to define the template and you’re good to go— see WordPress Theme Handbook for reference.
The child theme, then, is like an extension of the parent theme; it can have just as many template files as the parent theme does, if not more, and some that aren’t even available in the original parent theme. Now we can answer what is a WordPress child theme and why do people use WordPress child themes, so on to the next!
When Should You Use a Child Theme?
It’s easy to understand the answer to the question: what is a WordPress child theme, but it can be more difficult to answer the question when should you use a child theme? There are a few different reasons you would decide to use a WordPress child theme.
The decision stems from your particular needs, and most of the themes that we build for our own sites or client sites are actually child themes of the Genesis theme framework to begin with. It’s very rare these days that we would build a standalone custom WordPress theme from scratch.
There is great value for developers to streamline WordPress workflow by using pre-made themes and templates for WordPress, making a child theme of the Genesis framework a great way to do that.
For everyday users, it’s recommended that child themes are used only if you are constantly adding new functions to the functions.php file of your theme as well as adding or modifying the direct style.css file of the theme. If this is the case, we recommend that you use a WordPress child theme.
The choices you make in terms of a WordPress child theme will depend on how comfortable you are with technology and coding. If you are looking to add custom styles and only need to make changes to a few elements, a custom CSS plugin could do the job effectively.
If you are moving things around in CSS, changing large elements of the theme, etc., it may be in your best interest to use a child theme.
Picking a Good Parent Theme is INVALUABLE
Before we move on to the next section, it’s important to understand that all WordPress frameworks are parent themes, but not all parent themes are frameworks, which means that they are not optimized for being used as a parent theme.
Not all WordPress themes are meant to have a child-parent theme relationship, and while they all can have a child theme, it’s not advised that they do, especially if they aren’t designed that way. If you choose a parent theme that has limited functionality and create a child theme, you’ll be sorely disappointed and it will take you much, much longer, turning into a headache.
If you create a child theme and find that you’re replacing a lot of the files that are built into the parent theme, you may want to consider choosing a different parent theme. For instance, if you choose a theme that you like and create a child theme, but then add footer.php, header.php, and more, you should find a different theme.
The parent theme should be the basis for creating a custom child theme, not completely rebuilding the theme altogether. Otherwise, you may as well just build your own independent custom theme since all of the parent theme files will be overridden.
Advantages of Using a WordPress Child Theme
Aside from the what is a WordPress Child theme question, you should also be able to answer: what are the advantages and disadvantages of using a WordPress child theme?
Here, we’ll discuss the advantages to start.
1. Safe Updates
Because a child theme inherits all basic elements of the parent theme— style, features, and templates— you can make changes without ever touching the framework of the parent theme. You will then be able to safely update the parent theme as all of your customizations and modifications are saved within the child theme, so nothing will be lost.
When you create a complete theme, you'll have to create code for many different possible scenarios. When you have the child-parent theme dynamic, even if you forget to code for something in the child theme, the parent theme will have the functionality to cover it, creating a good fallback.
3. Easy to Customize
Since the child theme will have inherited an excellent theme framework from the parent theme, you’ll have a lot of flexibility with minimal coding needs. You can modify the elements that you see fit and leave the other template files alone, adding the functionality you need and much more.
Disadvantages of Using a Child Theme
As with anything, there are disadvantages of using a child theme as well. Here we’ll outline some of those.
1. Time to Learn Parent Theme
You’ll have a learning curve in understanding and learning the parent theme, especially when you work with ones that have expansive hooks and filters; you have to know how to take advantage of those. This can take a while, but it gets easier over time— after having created your first few child themes, you’ll be able to cut down on the time spent and you’ll be creating custom websites much more rapidly.
2. Abandoned Parent Themes
Sometimes a developer may lose interest in the theme and stop working on it, cut a feature that you implemented in your child theme, or change something that completely wipes out your child theme. This typically isn’t a huge issue, since most of the best WordPress themes are open source and GPL; many times people from the community even take over the project.
What’s more, just because a developer no longer deals with a theme doesn’t mean you have to scrap the use of it. If one of your favorite features is removed, you can just add it to your child theme because you have the code to do so.
If there is a big change that really upsets your child theme, you don’t have to update the parent theme. Your parent theme should be updated, though, if there is a security issue; it ensures that you’ll be able to use other scripts and plugins in the future.
In all likelihood, if you have a solid and reputable parent theme, chances are it isn’t going anywhere. Genesis, for example, has a huge business with thousands of worldwide customers, support teams, and even create plugins for removed widgets in case people still want to use them.
We hope that you can now confidently answer the question of what is a WordPress child theme and other related questions. You can create a child theme of any WordPress theme, but choose one that will not force you to make many changes to the framework itself.
When you only want to make minor changes, you can take advantage of a custom CSS plugin; if you plan to make a lot of big changes and begin to override the main files of the parent theme, you should probably create your own custom theme.
What do you think, can you describe what is a wordPress child theme and whether or not it's right for you? Let us know in the comments!