Did this ever happen to you? You tweak your site to get it just the way you want it. Or you pay someone to do that for you. Then, you update your theme only to discover that those changes are lost. What the heck just happened?
Here's how you need not ever have to worry about that again. Use a child theme.
Enter WordPress Child Themes
Many who use WordPress have heard of Child Themes. But a lot of folks really do not know how having one or not having one applies to their WordPress site. Why should they? Do they need one and why?
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
A Child Theme will allow you to have a separate set of files that you can then modify and tweak to your liking. Without having to change the original theme files. The original files are contained within the Parent Theme directory.
Parent themes are also known as frameworks. The Child Theme relies on the parent/framework files. In 99% of the cases the parent/framework is what is updated — not the child theme.
The parent/framework files are in a separate directory allowing you to modify and customize the child theme to your liking.
When you use a Parent/Framework/Child Theme combo you won't lose your customizations when updates are required for your Parent/Framework Theme. The Parent/Framework updates without impacting the Child Theme's files leaving your modifications in place.
Theme Style.css Customizations Aren't Lost!
If your current theme has it's very own control panel or options panel, you may have noticed a box that is labeled “Custom CSS”. There is one is WordPress too in Appearance > Customize.
This accomplishes the same thing in that you can add little CSS snippets in that box to customize the CSS of your site. Without having to modify the theme's main (Parent/Framework) CSS. Again, preserving your changes.
Most folks just want to change fonts, colors, sizes, padding and margins. Those parameters are contained in your themes style.css file. No child theme; those tweaks are wiped out with the next theme update.
By having a Child Theme in place, you avoid having to redo tweaks you make to your Child Theme's style.css file with every update. Now that's not to say that there won't be child theme updates. There will be.
That's why it is always wise to keep a log of any changes or CSS snippets you make and by date. This way, if for any number of reasons, you lose those changes, you can easily get them back in place.
Caution with PHP Files
The other file most folks want to tweak is the theme's functions.php file. This file is a gold-mine of potential for customization. The functions.php does what it says.
This file allows you to actually control functions of WordPress and your theme without having to ever touch the core functions.php file. Never make changes in Appearance > Themes > ThemeEditor.
Always FTP in and download the original file first. This way if your changes break your site, you can easily reinstate the original file. More on that in a bit…
Refrain from modifying PHP files until you are familiar
with PHP and how WordPress themes are structured.
Why would WordPress themes update? Bugs, security hardening, code fixes and just keeping up with WordPress. While themes do not update with the same frequency as plugins, at a certain point all themes do update.
Most updates do not directly affect themes, however, those that use core features or functionality of WordPress will most likely at some point have to be updated. If for no other reason that to keep up with WordPress. So, why risk losing all your hard work?
PRO TIP: How to Make File Modifications
Whenever you modify any WordPress files avoid doing so in the WordPress editor located in Appearance > Editor. Always make those changes off-site.
- Copy and paste the entire file you want to modify into notepad (or your editor of choice). Or FTP into your server and download the file you want to modify.
- Then using the style.css file as an example, save the file naming it styleORIG.css. You now have the original style sheet file to revert to if you don't like your changes. (You would rename it to style.css before uploading to restore.)
- Next, File > Save As again, and this time insert the date. For example: style060617.css. This is the file you'll make changes in to copy and paste back into the WordPress editor. (Or rename style.css and upload via FTP overwriting the original file on the server).
- Follow this process with each change you make in the future and you'll have a dated archive of the changes you've made so that you can always backtrack if need be.
You Really, Really Want to Use a Child Theme
This is why I have used child themes for years and recommend StudioPress. Why reinvent the wheel?
By using the Genesis Framework and Child Themes I can customize and tweak like crazy and never have to worry about my modifications being lost.
Due to the Genesis Framework's popularity, there are a growing number of Child Themes being developed to work in concert with Genesis. (More listed here…) I have used this combo for my own sites and recommend my clients do the same for well over a decade.
I don't have to worry about updates or the quality and support of the themes I use. Once I get a theme tweaked the way I like I can then concentrate on building out the site's content and my business. One less thing to worry about and makes my life easier.
Can You Create a Child Theme?
Yes, you can create a child theme for any theme you are using. If you are invested in a theme that doesn't use a framework or offer Child Themes you may want to consider creating one.
Child themes are pretty basic but you do have to have a pretty good understanding of WordPress and how it works. The good news is as with most things WordPress; there's a plugin for that!
Or, if you are using a theme that doesn't offer Child Themes or a Parent/Framework, maybe use that as an excuse to get a new WordPress theme that does.
Not using a child theme? What are you waiting for? The next update that will overwrite all your customizations?
At your service,
P.S. Disclosure: Some of the links in this post are “affiliate links.” Read my full Affiliate Disclosure Statement here.