Here we go, another post on child themes. But it’s worth saying again because it’s important. or “!important” Why yes you do need a WordPress child theme. Most of the time. Here’s the caveat, you need to use a child theme if you’re intending to modify the parent theme. Changing the files in the parent theme is a bad idea. In fact as ideas go it ranks right up there with hacking core as far as badness goes. I would sooner tug on Superman’s cape or do that other thing involving wind and liquid.
Here’s why. Themes get updated. Let’s say you’ve decided to make some modifications to your theme, like change the color of the headlines and create a couple of templates for special pages and maybe changing the way an archive looks for a particular category. Cool! Maybe you’ve gotten really crafty and modified the functions file to get some clever behavior going. Now you’re cookin’. You’ve taken that theme you downloaded from the repository and with blood, sweat and tears, or at least a few hours work, made it your own. Congratulations!
Meanwhile, Joe, the dedicated developer who created your theme has been working on following his mantra, Continuous Improvement. He’s gotten some requests for new functionality and has discovered a minor security hole in his code. He’s also been working hard and now he’s ready to release version 2.0. You go to your site and see that there’s an update available and you know that you need to keep everything updated to keep things secure and running smoothly. So of course you update.
And then you look at your site. And to your horror, all of your changes are gone! That’s right, because you made the changes in the parent theme, you’ve just overwritten all of your work and you’re back to square one. So long story short:
If you modify the files of the parent theme, you will lose those modifications when the theme is updated!
So that’s why you use a child theme. When can you not use a child theme? If you are absolutely not going to make any customizations to your theme. How do you create a child theme? I’m not telling. But there are some really great articles that do show you how. The best is probably right there in the WordPress Codex. Elegant Themes has a great blog for all things WordPress and they cover child themes here. So go make yourself a child theme and customize like a boss.
Leave a Reply