The WordPress Child Theme system allows you to make changes according to your needs without worrying about breaking the parent theme. You can even use this to edit existing core files and not lose any work when a future update comes around – which is excellent if many complicated features are in place!
You need to be careful when making changes. For example, if you make a change that breaks the parent theme, your child theme will also break.
Table of Contents
Let’s check more in detail about child themes, why we use and how it works.
What is a Child Theme in WordPress?
Child themes easily customize your WordPress website without changing the parent theme. A child theme is a WordPress theme that inherits the functionality, features, and style of another WordPress theme, the parent theme.
Creating a child theme is easy! It just requires two files, style.css, and functions.php. However, they can also become quite complex and have just as many template files as the parent theme.
The goal of the first step in creating a child theme is to choose one that will help you achieve your desired look and feel. It would be best to aim for something similar, so all changes are minimal.
Why do we use a Child Theme?
A child theme is a great way to create your WordPress themes while maintaining most of its features based on existing ones. You can quickly customize your website using a child theme without coding from scratch. Designers and developers often use them to speed up development time because they don’t need to dig too deep into site roots files. Child themes make it easy for us. Since we only have to modify the layers above instead of editing every aspect of our page, Tasks such as transferring and customizing CSS files can be done using your control panel’s file manager and the WordPress dashboard. In addition, child themes help to keep your themes up to date. It was a severe issue in the early days of WordPress.
When you update a WordPress theme, you will lose all of your customizations in that process. But using a child theme, your customizations are stored in the child theme and won’t be lost when you update the parent.
How to use a Child Theme in Bricks Builder
Use the Bricks child theme to make modifications and overwrite files. You can download it directly from your Bricks Builder account.
If you want to modify the Bricks Child Theme according to your branding needs, you can do so, but it is entirely optional. You can also skip this step.
In order to change the branding, you need to edit your child theme’s folder name and replace it with “Your-Brand-Name“, whatever word or phrase best suits YOUR BRAND. For example, we changed ours to “Bricks Ultra” here.
Here you need to change the Theme Name, Theme URI, description, and authors. Please do not change the Template name, as it links your child theme to the parent theme.
You can upload this child theme ZIP file (bricks-child.zip) like any other WordPress theme. First, go to Appearance → Themes and activate Bricks Child Theme. Then, open your style.css file, where you can write your CSS.
If you want to enqueue more js and CSS files, you can add that to your child theme’s function file:
How To Enqueue Scripts (JS) & Styles (CSS)
Make sure that only the front end & canvas are loading your custom CSS & JS, as it might affect the builder panel if it loads in editor mode. In terms of checking this, you need to use the bricks_is_builder_main() function:
Go to this WordPress developer doc to learn more about how WordPress child theme works.
A Complete Guide To Bricks Builder
Unlike the style.css file of a child, the theme does not override the functions.php file of the parent theme. Instead, it is always loaded beside the parent’s theme’s function.php, right before the parent file. It is a great way to create your WordPress themes while maintaining most of their features based on existing ones. You do not need to manually create a child theme for Bricks Builder. Instead, you can download it from your Bricks Builder account.