Web Shakehands
Web Shakehands

Language


Make "Child Theme" for WordPress



I have written about how to change the main picture for four times on this website.
Next, the important step is to make "Child Theme".

When you change the code of the file of the theme, you will realize that the changed part will return to the original when you upgrade the theme or the WordPress itself.

You`ll be in trouble if this happens.

I will omit difficult explanations.

To say it easily, child theme will not return to original if you put the changed files inside the child instead of the parent theme.

I will explain how to make this.

Please make a new folder "virtue-child" because we are making the child theme of "virtue".

The understandable name will be fine.
You will upload this folder.



Make 2 new files "style.css" and "function.php" inside the "virtue-child" folder, and place a code inside both files.



Inside "style.css", write "Theme Name:" and write "virtue-child" which is the name of the child theme.

On "Template:" write "virtue" which is the parent theme.

After writing the code, save it, and upload using the FTP.





Next, inside "function.php", place the code below.





Like the same as "style.css", upload the file using FTP.



After that, using the "Theme" button, we will change to "virtue-child" theme.

When you click "Theme", "virtue-child" will appear, so please install and activate.



You have changed to the child theme

When you want to change the code of "header.php", copy the file from "virtue" folder and paste it into the "virtue-child" folder.

For "style.css" and "function.php", you can add the code using this file inside the child theme.



The image above shows the "header.php" file copied from the "template" folder of the parent theme pasted inside "template" folder of the child theme.

Like this, you can take only the files that you want to change.

This is a very important method to change the codes of the files.
Please use this, and resist from returning to the original code.

このエントリーをはてなブックマークに追加


Newest WordPress Article !

2017-06-22 Use "BackWPup" plugin for WordPress to backup your data NEW!


2017 3/2 Make "Child Theme" for WordPress


2017 2/17 Change the main pictures of "Home, blog, sample, and the other" pages for WordPress


2017 2/02 Use PHP to change different main pictures on different pages for WordPress


2017 1/20 Set different main pictures for each page on WordPress


2017 1/5 The importance of the main picture for WordPress


Just enter your E-mail and you will receive free
mail magazine about how to make your website etc.
E-mail:
  

Go to top