As we talked about frameworks in the last post, this time I’ll focus on child themes. The term “child” is used because a child theme acts exactly like a child. It acquires some characteristics from the parent but it also develops its own. And works by its own, without depending too much on the parent theme.
What is a child theme?
Child themes are created when a developer wants to make some changes, customizations, or experiments on a theme, but he doesn’t want to lose the original code. So he saves it as a framework and starts to use his imagination by building another one, separately. These changes are part of a child theme and you can use it wherever you want, without any limitation. A child theme is basically a new theme that somehow “looks” like its parent, but which has its own utility and functionality.
Being able to use a child theme helps the users to style and design a theme by their own liking without losing the main code, features, and functionality. Also, they would save a lot of time by just making certain customizations and not building a new theme from scratch.
That’s why is very important to pick a very good and solid WordPress parent theme. In this case, it is mostly recommended to use a framework, which is a special theme created to always play the role of a parent. They have strong and high-quality code. a good functionality, and their own hooks, tools, and filters.
Why you should use a child theme?
Child themes are good at speeding up the development. This is possible because you don’t have to code everything by yourself, as they come with lots of built-in tools and customization options from the parent theme.
Instead of creating a new theme from scratch, you can use the framework to create a child theme. And this process can be very simple. Also, you can improve the child theme by adding to it new elements that don’t initially exist in the parent theme. You can add lots of options to a child theme. As many as a parent theme has or even more.
Pros and cons of using a child theme
Every tool and everything in life has its good and its bad part. That’s why I want to point out what makes a child theme useful and what doesn’t bring too much value to it.
- You can safely update your child theme without modifying the parent theme’s templates and features. And the reverse. You can update the parent theme without worrying if something goes bad with the child theme. The child theme “lives” separately. Any modification or update of the parent won’t affect the child.
- Starting from a parent theme, you can develop an even greater child theme and make it look stunning and work efficiently. So besides the flexibility and the freedom of modifying anything you want without having to write too much code, you also have the possibility to add new functionality and features. So you won’t have to limit yourself to what a parent theme has to offer.
- You always have the parent theme as a backup tool. When you create the child theme and you want to borrow some code lines or forget how to add a specific feature, the parent theme is always there for its “children”.
- To build a child theme, you need to know very well the parent first. Especially if the parent is something complex, like a framework, for instance. Learning how a framework works, it could take a while. Each framework has its own code and functionality and that’s why you should familiarize yourself with its elements. Building your first child themes could take you more time than usual. So meet the parent to “understand” the child.
- Sometimes, if the parent theme’s developers decide to not use it anymore and let it out of their business, you could be affected by their changes – removing an important feature or simplifying the core. It’s true that you can avoid updating your theme and use it as it was before, but updates are always very important for every WordPress product, no matter what kind.
Building child themes can be fun when you want to play with the features of another theme and you don’t want to lose it. Also, making changes and customizations will help you exercise and improve your coding skills and you don’t want to invest too much time in doing them.
Creating a child theme is not absolutely necessary, even if you can build it of every WordPress theme. Most of the time, a child theme is a good solution if you plan to make some massive changes or remove some interesting and important features from the parent theme and you don’t want to lose them. But you don’t have to create a child theme for every new small thing you want to add to your theme.