PHPMatters Help You Better Hosting Your PHP-based Sites
How to Make Child Theme for WordPress Site - Customize Theme Risk Free

How to Make Child Theme for WordPress Site – Customize Theme Risk Free

When people enter your website, the overall design can be the first thing flashing in front of them, affecting their first impression on your site greatly. In this case, you need to try your best to achieve a unique and stylish website design, picking readers’ attention and retaining them to read your contents. This can be done easily by installing the quality themes and templates created by some experienced theme developers or third parties. Also, you can make some changes and modifications on your own to make these themes meet your needs fully with the beautiful appearance and proper layout.

In the following, we have listed the simple steps telling you how to make a child theme, which is an essential process before theme changing.

Why Create Child Theme

In fact, the child theme can be regarded as a duplication as your original theme, coming with the same features and functions and allowing you to make modifications freely. In fact, you can also change the settings on your original theme or parent theme, but these changes might be erased when this theme is updated by the theme designers. The child theme, however, can retain the changes you have made permanently whenever the parent theme is upgraded or modified.

How to Get Started

To create a child theme for your parent one, you firstly need to create a new folder exclusively for your child theme within the theme directory that is named as wp-content/themes. Although you can decide the name for the new folder the way you like, we still suggest you to name it the same way as the folder of your parent theme, attaching a suffix of “-childtheme” or “-child”. This is a common way for easy and effective theme management and identification.

child theme folder

With this folder, you need to create a new file to host the coding stuff for your child theme. Note that the new file needs to be called as style.css, otherwise WordPress may fail to recognize it and disallow your child theme to override your parent theme. Then, you have to enter the following lines of code into this file.

child theme coding

The above coding is simply an example for you. You can copy it and paste to your child theme file, and make changes based on the real situation. Here, we have to mention that the information of the parent theme needs to be absolutely correct, otherwise you may encounter some problems when activating your child theme for it cannot inherits the features of the parent one.

In addition, the import URL needs to be exactly the file name of your child theme, for it acts as a channel to import the coding of the child theme to WordPress.

Below the import URL, you can add the CSS coding to change the style, layout, color schemes, background image, font, sidebar, and many more the way you want.

After that, now you need to upload and activate the CSS file for your child theme. Simply login to your WordPress dashboard and click the Themes button that is located at the dropdown menu of Appearance tab. Then, you can find all the themes included in your website. If you cannot find your child theme, simply upload it by clicking the upload button with a ZIP format. Upon successful uploading, now you simply need to click the Activate button, enabling your child theme to override the parent theme.

activate WordPress theme