I started this post yesterday and didn’t get it finished (that’s a subject for another post). And in a wonderful display of synchronicity, while checking my blogging groups on Facebook this morning, I saw a post from someone asking about child themes. And the reply really struck a chord with me because she used an analogy that I often use when explaining WordPress. She said your theme is like your house, and the child theme is how you can decorate it.
So. I am making a child theme for this blog. A child theme lets me modify a parent theme as much as I want. I can change the child theme without impacting the parent theme, and this enables me to create custom child themes based on the same parent theme, for a number of different projects.
This is something I have done many, many times, both for myself and for my clients. Usually, I just do a lot of CSS to customize the look and feel of the site. This time I need to make some fundamental changes in the way the various sections of the pages are actually called from the server, specifically in the footer. The footer for this theme calls for three widget areas. I need four.
When a website loads, WordPress first loads the child theme, and then inherits any missing styles and functions from the parent theme. So all I have to do for the child theme is to write the code that makes the changes I want – the parent theme does the rest.
In this case, I have to not only write a bunch of CSS, but also some extra code for the functions.php file as well as for the footer.php file. I’ll save all of them in my child theme so that when my parent theme, updates, I won’t lose the changes.
It will take me a little time – I’m a bit rusty on PHP and I can read it better than I can write it – those pesky semicolons mess me up sometimes. But by the end of the week I should have four widget areas in my footer! Check back and see!
Do you blog? If you do, do you use a child theme? Comment below!