Child Theme

Child theme borrow all features and appearance of parent theme and allow change them without touching the code of parent theme.

Use Child theme if you want to make theme code changes. If you add code directly to your theme’s files, then your changes will get overwritten when you update your theme. Child theme solve this problem by allowing you to add your customizations in child theme. This way when you update the parent theme, all your changes will remain intact.

How to Install Child Theme #

Installing the WordPress child theme is no different than installing any other WordPress theme.

In the theme pack you will see materials for the child theme. It’s located in the archive.

Go to Appearance » Themes page and click on the Add New button.

Click on the Upload Theme button. This will show you theme upload option.

Click on the choose file button to select the file from your computer and then click on the Install Now button.

WordPress will now upload the theme zip file from your computer and install it.

WordPress will also check if the parent theme is installed. If for some reason you don’t have parent theme installed, you need to install same way as for the child theme.

After installing both parent and child themes, you can go ahead and activate the child theme.

Recommendations for Child Theme Usage #

1. Almost all files from the main theme can be replaced in the child theme

It doesn’t concern only .php-files with templates and basic logics, but also both .js, .css files from respective folders and files with images, icons etc..

2. Change theme functions or add new ones

If you want to change some of the theme’s functions or to add new ones, you need to create file functions.php in the folder infolio-child, and add all required functions into it. If our theme contains functions with such names, they will be replaced with yours, if not – your functions will complete our theme’s logics.

3. Keep folders & files hierarchy

As for other files – put out templates from the folder templates-parts ( maintaining files hierarchy ), images from the folder images etc. – to make changes, copy theme into the folder infolio-child and make changes there.