Child Theme in WordPress has become a standard the past few years for the majority of the developers. The reason is, even if you get a theme full of features and options, there may be something you need that is missing. Indeed, the web is everywhere nowadays and even the most flexible theme will not be able to fulfill every need of every user. And, most probably it isn’t designed to do so. That’s why its a great idea to create and use a child theme on your website.
What is a child theme
A child theme in WordPress is a special type of theme that inherits all functions and styling from a parent theme. It can apply to any valid WordPress theme. The process of adding a child theme is pretty straightforward thus, anyone can create one. For the purpose of easiness, many theme publishers include the child theme by default in their theme packages.
Creative freedom
The flexibility of a theme allows for various configurations and an experienced user can make the best out of it. In some cases, you may need to go further than the customization allowed by the theme options. Namely, you may need to touch the code, add a new PHP filter, insert a Javascript snippet or create a custom style. Whereas you are about to create something unique, you know that eventually, you are going to update the theme. If you work on the parent theme you will need to apply all custom code again after updating. But if you have installed and activated the child theme your changes will be maintained.
Safety net
Even if you are not planning to customize the theme, it’s better to deploy on a child theme as you are having an immediate “fallback” theme in case you mess up with a setting and you don’t want to reset the whole section. Indeed, on a properly configured website, switching between child-parent theme is easy and, depending on the extent of the customization you have performed, it’s wont actually destruct the end user experience. After reviewing the default settings, you can switch back to the child theme and move on.
Controversy
Some people are claiming that there is no need to use a Child Theme as WordPress is considered to be a very good platform and won’t easily “break down” even if you make mistakes. Even though this is quite true regarding most CSS changes when it comes to PHP or Javascript things are more complicated. A poor written CSS in most cases will not even affect the website. Given the fact most themes are using dynamically produced style sheets with LESS, an error will be ignored. Someone cannot claim the same for PHP or Javascript where even an empty character can have a huge impact on the page. In addition, we shouldn’t count on the developers for not making mistakes as they are humans after all.
Conclusion
To keep up with your work without stressful or wishful thinking, use a Child Theme. It’s the second most important thing after keeping a backup for any website (which now it’s easier than ever). Just, add the child theme in parallel to the parent and activate it.
Plethora Themes include the child theme in the package so you don’t have to waste time building one.
[…] theme files, either directly on the parent theme or by overriding these template files in the child theme folder, when doing so, you are running the risk of losing the changes on your next theme update or […]