What is WordPress Child theme?

1.80K viewsWordPress

What is WordPress Child theme?

When we developing a WordPress website, Sometimes we need custom coding apart from using plugins. Because using Custom codes is more Easy or Better than using plugins for that process. So when we custom coding a WordPress theme, mainly we code the functions.php & style.css which is located in theme folder. functions.php consist all major PHP functions of the website and style.css file consist all the main CSS styles. So we can include our own custom functions and CSS styles and run throughout the website.

But some when we integrating a function on functions.php file and after running it, website can be crashed due to some reasons. If you’re editing fuctions.php via WordPress Theme editor, it automatically roll-back to previous version. But if you’re editing functions.php from FTP, it do not rollback. We have to mannually remove that code.

So because of this, Most of WordPress theme developer provide us a child-theme. And also if a theme has no a child-theme, we can custom build one.

Child-theme is like the son/daughter of Main theme. It includes functions.php & style.css files. Now when we want to integrate custom code on Main theme, we do not use the Main theme’s functions.php file style.css file.

We can use Child-theme’s ones. It’s secure because when damaging the file, Main theme files are protected.

How to install Child-theme?

In you theme folder, there will a Zip folder named Child-theme. You can simply upload it to WordPress themes and Activate it. Then you can code your all customs functions on Child-theme’s files.

Nimesh Asked question February 15, 2022
1