If you’re new to WordPress or just curious about how your website works, you’ll want an understanding of themes and child themes.
What is a Theme?
The WordPress Codex defines a theme as “…a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called template files. A Theme modifies the way the site is displayed, without modifying the underlying software.”
In other words, the theme will dictate the WordPress site’s style and functional capabilities.
What is a Child Theme?
The WordPress Codex describes a child theme as one that, “…inherits the functionality and styling of another theme, called the parent theme.”
Put simply, the child theme’s purpose is to contain customisations to your website and extend the parent theme’s functionality, all of which is usually not affected by updates to the parent.
Why Does This Matter?
WordPress Developers mainly use child themes to prevent losing customisations during theme updates. Using a child theme allows developers the opportunity to customise the code without any of the core files being touched. The parent theme can continue to go through updates and upgrades without affecting the child theme.
There are some really heavy-duty themes out there that can do some brilliant stuff. For any website, you should choose a theme based on what functions it offers and how customisable it is – whilst being as lightweight as possible.
Of course, WordPress themes are often updated regularly (if yours isn’t, ditch it before it becomes a risk to your business). Security updates are clearly a priority as well as bug fixes and upgrades to functionality.
If you’ve modified your parent theme directly, any modifications that have been made would be overwritten. That means you’ll lose the customisations you’ve made to the functionality of the site. The consequences of which aren’t always immediately obvious.
It’s not wise to skip these updates for obvious reasons. Missing updates could create security issues amongst other things and your site could be left open to hacking. Especially given that hackers prey on outdated websites using known exploits.
Design and Functionality
It’s safe to assume that sooner or later, everyone will need to update or adapt their website. Whether to fix a bug or because of a change in business requirements, or even branding.
If all the customisations you want to make can be made in the WordPress Customiser, you probably don’t need a child theme. These settings are stored in the site’s database and aren’t affected by any updates to your themes.
However, you’ll definitely need a child theme if you’re planning on altering the underlying code of the theme. These alterations would be overwritten during an update. This includes any of the theme’s PHP files and it’s CSS style-sheet, and of course, any code added to your theme’s functions.php file.
What Happens to My Child Theme During WordPress Updates?
The whole point of having a child theme is so that you don’t lose customisations when the parent theme is updated. It’s rare that you would need to update your child theme. Particularly if you’ve sourced your theme from a reputable author! However, it is sometimes a necessity. It isn’t too much of an issue if you know what you’re doing. Especially if the author of the parent theme gives plenty of notice and details of what will be changed.
In short, your child theme allows safe editing and modification of your site. It enables you to create a safety net for your customisations whilst utilising the functionality of the parent theme. If you plan on amending the code of the theme in any way, you need a child theme.
If you’re looking to extend the functionality of your site in the future, it’s best to start as you mean to go on. As with any business, needs change over time and your website will naturally evolve. So having a child theme already in place is a smart move.
Child themes are not always necessary, but it certainly makes sense to have one.