WordPress Child Themes allow you to change small aspects of your site’s appearance yet still preserve your theme’s look and functionality. To understand how child themes work it is first important to understand the relationship between parent and child themes.
A lot of our users ask us which template are we using? Our response is that we are using a custom child theme built on the Genesis theme framework. The follow-up question most of the time is a two-part question. What is a WordPress theme framework?
The second part of the question is what is a WordPress child theme? In this article, I will do my best to answer questions like what is a WordPress child theme, when should you create a child theme, why do people create child themes, and lastly advantages and disadvantages of using a child theme.
My hope is that after reading this article, you will have a clear understanding of what is a WordPress child theme, and you will know whether you should use a child theme or not.
What are WordPress Child Themes?
WordPress child themes are WordPress themes that inherit its functionality from another WordPress theme, the parent theme. Child themes are often used when you want to customize or tweak an existing WordPress theme without losing the ability to upgrade that theme.
In the past, there was no easy way of updating WordPress themes without losing all the custom styling and changes that you had made. This becomes chaos when all of a sudden you find out a widely used script in popular themes has a major exploit. And therefore, in that case, you need to update your themes ASAP.
It becomes a tough choice because, on one hand, you would lose all the custom styles if you update. On the other hand, you risk your site getting hacked if you don’t update fast enough. The core team and the community decided to solve this problem by introducing the concept of the parent theme and a child theme.
Here is how WordPress Child Themes help:
- make your modifications portable and replicable;
- keep customization separate from parent theme functions;
- allow parent themes to be updated without destroying your modifications;
- allow you to take advantage of the effort and testing put into parent theme;
- save on development time since you are not recreating the wheel; and
- are a great way to start learning about theme development.
If you are making extensive customizations – beyond styles and a few theme files – creating a parent theme might be a better option than a child theme. Creating a parent theme allows you to avoid issues with deprecated code in the future.
This needs to be decided on a case-by-case basis. Using WordPress child themes lets you upgrade the parent theme without affecting the customizations you’ve made to your site.
How is WordPress Child Themes different from Parent?
A child theme in WordPress would inherit all the functionality, features, and the code of the parent theme without making any changes to the parent theme itself. This allowed users to change the styling of the parent theme and add/modify features without losing the ability to update the parent theme.
In theory, any WordPress theme can have child themes however not all WordPress themes are good parent themes. A parent theme with limited functionality and features is not exactly an ideal parent theme candidate in most cases. We will talk about the exceptions later on in the article.
A good parent theme is also known as theme frameworks usually contains its own action hooks and filters. This allows designers and developers to create a robust custom WordPress site using child themes in a fraction of time.
Why do people use WordPress Child Themes?
As indicated in the overview, WordPress child themes inherit the look and feel of the parent theme and all of its functions, but can be used to make modifications to any part of the theme. In this way, customizations are kept separate from the parent theme’s files.
On the other hand, a parent theme is a complete theme that includes all of the required WordPress template files and assets for the theme to work. All themes – excluding child themes – are considered parent themes.
Designers and developers use child themes to speed up their development. When using a good parent theme, you can drastically reduce the time it takes for you to create a WordPress site. All good parent themes aka theme frameworks offer tons of functionality and customization options. So, you don’t have to code everything.
As an example, DIY users often create child themes to tweak an existing theme without losing the ability to update the parent theme if needed. Creating WordPress child themes can be as simple as creating a new style.css file in a new folder. All you really need is one line in your new style.css header that defines the template (see the Codex for reference).
Important to realize, a robust child theme can have just as many template files as the parent theme if not more. A child theme can have template files that are not even available in the parent theme.
When Should You Use a Child Theme?
The decision to use a child theme often depends on your needs. Most sites that we build for ourselves and our clients are child themes of the Genesis theme framework. In rare cases when the project is too complex or too simple, then we build it as a standalone custom WordPress theme.
As WordPress developers, we need to streamline our workflow while creating quality themes. Creating a child theme of the Genesis framework helps us accomplish just that. For users, I recommend WordPress child themes only if you find yourself constantly adding new functions to your theme’s functions.
For instance, the php file and/or constantly adding/modifying the style.css file of your theme. In these cases, I highly recommend that you use a child theme.
Is it better to use a child theme or a custom CSS plugin?
The answer to that depends on how savvy and comfortable you are with technology. If you are only modifying the styles of a few elements, then using a custom CSS plugin works just fine. However, if you find yourself changing the entire color scheme, moving things around in the CSS, etc, then you definitely should consider using a child theme.
Is Picking a Good WordPress Parent Theme important?
Of course, all WordPress frameworks are parent themes, but not all parent themes are frameworks. Although, I cannot stress this enough. While any WordPress theme can have child themes, not all of them are meant to be used as theme frameworks.
In fact, I’ve seen numerous beginners who make the mistakes of creating a child theme of a parent theme that doesn’t offer much functionality. In that case, if you are creating a child theme where you find yourself replacing a lot of the parent theme files, then you should rethink your process. For example, you really like the Twenty Twenty Theme, and you decided to create a child theme.
In your child theme, you had the style.css file, and functions.php file. On top of that, you decided that you don’t like the way the footer looks, so added footer.php. Same for header, etc. If this is the case, then you shouldn’t be using Twenty Twenty Theme as a parent theme. Rather you should be using it as a starter theme that you turn into your own custom theme.
Eventually, I’ve had several users who created custom child themes which really should be totally independent custom themes. Often, because they had overridden almost all of the parent theme files. In short, you should use a child theme when you need the functionality, features, and awesomeness of a powerful parent theme without writing much code for it yourself.
What are the Advantages of WordPress Child Themes?
Like most things, there are advantages and disadvantages to using a WordPress Child theme. Let’s take a look at advantages first.
1. Safe Updates
A child theme automatically inherits the parent theme’s features, styles, and templates. This allows you to make changes to your site using child themes without ever modifying the parent theme. When a new version of the parent theme arrives, you can safely update it as all your modifications are saved in the child theme.
2. Easy to Extend
A child theme built on a powerful theme framework allows a great deal of flexibility without writing a lot of code. You can selectively modify only the template files and functions that you need without going through other template files. You can add new functionality and much more.
3. Fallback Safe
When you are creating a complete theme you need to think about all the possible scenarios and code for them. However, when you are working on a child theme and you forget to code for something, then there is always the parent theme’s functionality available as the fallback option.
What are the Disadvantages of WordPress Child Themes?
One of the biggest disadvantages of using child themes is the time you need to invest to learn about the parent theme. There is a learning curve especially when you are working with robust frameworks because each of them has its own hooks and filters. You really have to know those to maximize the potential.
In my opinion, this learning curve is a one-time thing. For example, the first few child themes that you create might take you longer. But after that, you will be creating custom websites in a fraction of time. Your overall performance will improve.
Another disadvantage often pointed out is that your parent theme’s developers may lose interest and abandon it. In the end, dropping a feature that you were using in your child theme. Or even, bring a change that totally destroys your child’s theme. This is not as bad as it sounds. Mainly because all good WordPress themes are open source and GPL.
If the parent theme developer abandons the project, then nothing says that you have to stop using it. Often times, other folks in the community step up to take over the project. And if the original theme developers remove a certain feature, then you can simply add it in your child theme. You have the code for it.
Lastly, if they make a drastic change that you don’t like, then you can always avoid updating. Always remember, theme updates are crucial when there is a security exploit. So to say, I always recommend users to update themes because it helps ensure future compatibility with other scripts and plugins.
If you are using a commercial theme framework like Genesis, then you have a support option available to help you upgrade your theme or troubleshoot problems. Also, a platform like Genesis is not going to just disappear because there is a stable business organization behind it. And even, with thousands of customers worldwide.
It is important to know that even though you can always create a child theme of any WordPress theme, sometimes you may not need a child theme. In the first place, think about the number of changes you have planned for your child theme.
And then again, if the changes you are planning are minor, then you can always create a
custom-style.css file in your theme or use a Custom CSS plugin. Secondly, if the changes are too extreme where you find yourself overriding the core parent theme files, then you probably should be creating a custom theme.
Finally, I hope that this article helps you understand what are WordPress Child Themes and whether it is a good fit for you or not. If you think I missed something, then please let me know in the comments below. You can also Contact Us for more tailored or customized service solutions support.