A WordPress child theme: you may not have heard of it often, but it is indeed important. WordPress regularly releases updates. These can be for the core WordPress files, but also for plugins and themes. When you install a new version of a theme, you overwrite any changes you made to the code. If you don’t install the update, your site could get hacked or may not function properly in the future. Using a child theme can prevent this. It allows you to copy the site’s functionalities and design into a separate, new folder. WordPress won’t touch that folder during updates, ensuring your site always works perfectly. In this text, we will explain how to modify a WordPress theme with a WordPress child theme.
What is a Child Theme for WordPress?
Before we dive deeper into the topic, let’s first explain what a WordPress child theme actually is. A parent theme and a child theme in WordPress are connected and work as a unit. The parent theme is the main one and contains the core code. The child theme contains additional or customized code, such as changes to the site’s layout or a different logo. If you decide to update the site’s parent theme, WordPress will leave the associated child theme untouched. This means you don’t have to reapply the changes you made. An added benefit is that a child theme allows you to experiment with minimal risk. If the changes don’t work out, you can simply start over, and important files remain untouched.
A child theme is ideal for experimentation. If things go wrong, you just start over.
When should you choose to create a WordPress child theme?
Wondering when it’s best to create a WordPress child theme? We can give a short and simple answer: always. Even if you don’t plan to make changes to your parent theme immediately. With a free plugin, you can easily create a child theme from your current template. You can then use this when you (or your web developer) want to make adjustments to the WordPress theme in the future. When you decide to customize the WordPress theme, you might consider changes like font size, colors, or adding extra functionalities. You can make it as complex as you want, and of course, your changes will remain intact after an update.
What are the Benefits of Child Themes?
The biggest advantage of a child theme is that your WordPress theme remains unchanged after an update. But there are other benefits, which we’ll list below for you.
Customize Your Website Fully to Your Liking
With a WordPress child theme, you can completely customize your website, both in terms of design and functionality. You can apply security updates to the parent theme without accidentally overwriting any files you’ve previously modified.
No Need to Reinvent the Wheel
Using a WordPress child theme saves you from doing unnecessary work. Simply choose a template for your site that you’re mostly happy with, and then make adjustments in the child theme to tailor it to your exact preferences.
Learn to Code with a Child Theme
Customizing the look of your WordPress website is simpler than you might think. With a child theme, you can quickly and easily fix any mistakes you make. Often, just a few tweaks to the layout are enough, and you don’t even need to be a programmer to do it.
Updating your WordPress site? With a Child Theme, you won’t overwrite any customized files.
How to Add a Child Theme to WordPress?
There are different ways to add a child theme to WordPress. You can do it manually, or you can use a plugin. If you choose the manual approach, you’ll have the most control. You copy the files yourself, edit them in a text editor, and then upload them. Creating a WordPress child theme yourself is definitely doable, and there are clear tutorials available on YouTube. Keep in mind that creating a child theme on WordPress requires patience and attention to detail.
Want to create a child theme without technical hassle? Then use one of these handy plugins. The Child Theme Generator is super simple and quick, while the Child Theme Configurator offers more options for customization. Once your child theme is created, you can select it under the ‘Appearance’ tab. After that, you can deactivate and remove the plugin since it’s no longer needed.
💡 Good to know: Many premium WordPress themes include a child theme. You can install it separately and customize it as needed.
Does a Child Theme for WordPress Have Any Drawbacks?
Since it’s useful for you to be able to manually create a child theme, we’ll briefly explain how to do it below. Ideally, perform these steps in a development environment, not directly on your live website. This way, you’ll have plenty of time to test changes.
With a plugin, you can easily create a child theme without any technical knowledge.
How to Manually Create a Child Theme?
WordPress clearly explains how to create a child theme in this article. Below are the main steps. It’s best to carry them out in a development environment, not directly on your live site, so you can try out changes without any pressure.
Step 1. Create an Empty Folder for Your Child Theme
WordPress software consists of various files and folders. Themes are located in the ‘/wp-content/themes/
‘ folder. Using a file manager program like the free ‘Filezilla’, and with the login details from your hosting provider, navigate to this folder. Create an empty folder and name it the same as your parent theme, but end it with -child
. For example, if your parent theme is called ‘twentyfifteen, name the child theme folder ” twentyfifteen-child
‘.
Step 2. Create a CSS File in the Empty Folder
Your WordPress site needs to know that you’re using a parent theme. You indicate this in a CSS file in your child theme’s folder. Download the free editor Notepad++, then copy and paste the CSS code from the page ‘https://developer.wordpress.org/themes/advanced-topics/child-themes/#2-create-a-stylesheet-style-css’ and modify the fields. The fields for ‘Theme Name’ and ‘Template’ are required. In this case, under Template, enter ‘twentyfifteen'
and save the file as style.css
.
Step 3. Link the Stylesheets to the Child Theme
The next step is to link the stylesheets to the child theme. How this works exactly depends on the theme and often it works automatically. Not the case for your theme? Then check the instructions on WordPress.
Step 4. Install the child theme
Install the child theme in WordPress just like you would a regular theme.
Step 5. Activate the child theme under Appearance > Themes
Any changes you make to the stylesheet from now on will be visible on the site. This allows you to experiment with fonts, colors, and design.
Have you previously made changes directly to the main theme without using a child theme? That’s okay. Simply copy the modified code from the main theme’s stylesheet into the child theme’s stylesheet. When you update the main theme in the future, WordPress will use the copied settings from the child theme.
💡 Tip. There are useful CSS plugins for Firefox and Chrome, such as CSS Scan. When you activate the plugin and click on an element of a web page, you can see which code is responsible for it.
💡 Tip. You can also visually adjust the code directly in the browser and see the difference immediately. Once you’re satisfied, you can apply the changes permanently in the corresponding stylesheet.
Help, I’ve already modified my main theme!
Have you previously made changes directly to the main theme without using a child theme? Don’t worry. Simply copy the modified code from the main theme’s stylesheet into the child theme’s stylesheet.
If you update the main theme in the future, WordPress will use the copied settings from the child theme.
How do you edit the footer in a child theme?
A WordPress theme usually consists of multiple files and stylesheets. For example, your theme may include a file called 'footer.php
‘, which contains the settings for the footer, such as ‘©2021’. You can modify the 'footer.php
‘ file in the main theme, but it’s better to make a copy instead. Download a copy of the file via FTP to your hard drive. Then edit it, for example using Notepad++, and save the changes. Upload the modified ‘footer.php
‘ file via FTP to the folder of your child theme, replacing the old file.
How to create a child theme using a plugin
If you prefer to create a child theme in WordPress using a plugin, that’s absolutely possible. With the ‘Child Theme Configurator’ the process is quick and easy.
Here’s how a Child Theme Configurator works:
- Install and activate the plugin.
- Go to “Tools -> ‘Child Themes’.
- Indicate that you want to create a child theme and select the ‘parent theme’.
- The plugin will now analyze the parent theme.
- Make any changes if needed, depending on your theme and preferences.
- Confirm the settings by clicking ‘Create New Child Theme’.
- Activate the new theme under ‘Appearance → Themes’.
After this, you can technically remove the plugin from your website.
Avoid mistakes on your live website and test changes in advance
In WordPress, it’s easy to make changes, and adjustments via your theme’s settings usually go smoothly. However, modifying the code comes with greater risks. Just one small typo can take down your entire website. Of course, this can usually be fixed quickly – but it’s still a shock, especially if you don’t have much experience. That’s why it’s important to choose a hosting provider that makes daily backups, and ideally, test your changes on a staging site or at least in a test environment first. This way, there’s no risk, and nothing can go seriously wrong.
With a child theme, your website always performs at its best
In short: if you want to customize a WordPress theme, always do so using a child theme. This allows you to experiment freely, and your settings will remain intact even after an update. Want to learn more about WordPress child themes? Feel free to contact our specialists – they’ll be happy to help.
Comments
No comments yet.