How to use a child theme

Firstly, if you need small css changes you can use the CSS Options (to place your code) in Theme Options.
For more advanced customization it’s better to use a Child Theme ( A sample Child Theme is provided in the file).

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.

More information can be found on the official WordPress Codex:

For example, if you’ve ever edited PHP files (or JS files), then you know how hard it can be to upgrade your theme later.

Generally, a WordPress child theme allows you to modify or/and add functionality of that parent theme. So install both themes (themename and themename-child), activate the child theme and you ensure that changes you make to the files are not overwritten when upgrading the main theme.

If you need to edit PHP files(or JS files), the first thing you need to do is replicate the old file before we start to modify it. So, copy and paste the theme’s original file into your child theme folder ensuring that the file name and location is exactly the same. For example, if you want to modify the themename/folder-name/file1.php, then you would copy and paste this file to themename-child/folder-name/file1.php. Then, you can open and make any necessary changes.

When you activate the Child Theme you need to assign again your Menus Locations and Widgets.

  • Appearance – Menus – Theme Locations
  • Appearance – Widgets

By using a child theme, you don’t have to worry about the updates of the parent Theme.

Was this article helpful?

Related Articles