What is a child theme?
With a child theme you can make a variant of an existing theme without your changes being undone when the original ‘main’ theme is updated.
This way you can change the layout of a theme and adjust or add functions without touching the original theme.
How to create a child theme?
- Create a new folder via FTP in the folder: wp-content/themes/ bv:themex-child.
- Create a document style.css in this folder.
- Put this code at the top in this style.css:
Theme Name: ThemeX Child
Theme URI: http://yourdomain.be/
Description: Theme X Child Theme
Author: Your name
Author URI: http://yourdomain.be/
Tags: place, here, your, tags, separated, by, commas
Text Domain: themex-child
/* =Put custom CSS below
————————————————– ———— */
- Adjust what applies to you. With the code @import url(“../theme/style.css”); load the styles of the original theme.
Modify the CSS file as desired. Any style elements you use here will override those of the ‘main’ theme.
- Activating your child theme is done via view > themes in the WordPress backend.
You can of course continue to customize your style.css.
In addition to the style, you can also adjust template files. For example, if you want to customize your header.php, you do the same as with the style.css document above.
Do you need a helping hand in creating a child theme? A WordPress specialist in Antwerp will reach out to you.