Child themes in Wordpress's picture

Child themes in Wordpress

Child themes are like inherited themes

I have to admit myself that this term is cryptic to those start out on their blogging journey. Basically put, it's a copypasta of parent themes ( which is the theme that you're using ) but the catch here is that you only work with certain components or files that you want to change, just like Additional CSS editor that the Customize function offers.


Why is it so useful for Wordpress developers and non-developers alike

From a website developer's standpoint, this can prove to be a huge bonus to for those of you who don't want to code everything from scratch yet want to expedite the delivery of their service. f I'm not being mistaken, it's like GitHub cloning function, open-source CMSs, and Visual Studio Code being bundled together in one place.

This is not gonna be another tutorial since the Internet is already full of them, but I'm gonna give a quick rundown. From my experience, normally web developers have to clone the codebase of a website from GitHub ( if they edit it for the first time ), then they'll have to scour the whole codebase for bugs in Visual Studio Code.

The process can be painstaking as manual edits like these presents the risk of accidental misedits. Unless they decide to style their website with Tailwind CSS or Material UI, there's a high chance you'll have to work extensively with CSS, and a typical stylesheet for a blog can easily go over 600 lines of code.

I'd honestly freak out and get paralyzed. Because changing one specific bracket can spell change across the whole blog, and to circumvent this you'll have to custom write the styles for each component or override the existing code with newer code, which will make the codebase even more clunkier. In short, you're in full control of your codebase, but the work will be long and tedious. Child themes, on the other hand, abstracts out all the irrelevant code and you only have to work with the files that you need to change.


Why I use Wordpress child themes

Technically I could use this on anything, be it a header or a footer or any component you can find in your blog. I use Child Theme Configurator as instructed in the video and cloned files for the header and footer. They are named headers.php and footers.php respectively. The first time I used this child theme is when I customize the footer for my own benefit. I included the HTML for the footer in the functions.php file, and styled the HTML in the stylesheet like the picture above. Child theme is only good for small edits and functionality tweaking, but I understand web dev enough that you need to code the whole codebase from cPanel if you want to do bigger edits, let's say customizing the server code and making site-wide changes to the theme.



← Back to home