Things will be much easier and less complicated if you create a child theme from the start. But, if you have already edited the parent theme files many times earlier without creating any child theme, then you may need to import those modifications into your child theme. This will protect your modifications during parent theme update. Here are the steps that will show you how to create child theme from modified existing theme. If you have a unmodified parent theme and is wanting to make a new child theme from the start then check our article on “How to Create Child Theme in WordPress”.
How to Create Child Theme from Modified Existing Theme
First create a full backup of your modified parent theme using FTP or your Web Hosts file manager. The backup will help you to revert back if things don’t work out. If you want to back up using cPanel you can see our tutorial on “Backup WordPress Database using cPanel.” We also have article on how to back up WordPress site manually and automatically.
For this purpose we will be using a plugin called Child Theme Configurator. Install the plugin by going to Plugins >Add New.
Once you have successfully installed and activated go to Tools > Child Themes from WordPress dashboard menu.
This will take you to the Child Theme Configuration page. In the Parent/Child Tab, select create a new child theme option. Choose the parent theme whose child theme you want to create and click analyze button.
Once you click analyze button, you will be given tons of configurations settings which you can change according to your wish. One of the important setting is given in number 8. Make sure you check the “Copy Parent Theme Menus, Widgets and other Options” checkbox.
Now you can click Create New Child Theme button at the end to create you new child theme. But do not activate the child tab yet.
Next go to the Files tab. Here you will find all the files in the parent theme. Select the files that which you have modified in the parent theme. And then click “Copy Selected to Child Theme“. This will copy the selected files in the child theme folder.
The trickiest part is to copy the modified CSS styles from your parent to your child theme. The easiest way of doing this is to download your modified “style.css” file from the parent theme. And then run a difference check against the original parent “style.css” file. Select the differences you find and move any selector blocks over to a separate file. You can use any advance text editor like Notepad++ and TextWrangler to find differences between two files. You can also do this manually without the help of any advanced editor. Open the modified stylesheet and copy any blocks of codes that you have changed. Save the copied and modified codes to a separate text file.
Next move back to your plugin configuration page. Open the Query/Selector tab and paste the entire modified CSS code you copied earlier into the Raw CSS textarea box. Finally click the save button in the left of the box.
Now your child theme should be ready. To see how your new theme looks go to Appearance > Themes click “Live Preview” on the child themes icon.
Check if your child theme looks as you expected. If you find anything is missing repeat the above step until everything is working. After you are sure that all of your modification from parent theme is successfully copied to the child theme, you can re-install the brand new parent theme. If you find anything is not working, check your initial steps. If things go too much wrong then revert to the backup parent theme and repeat the process from start. Finally if everything look good, go to Appearance > Themes and activate your new child theme. Now you can make any kinds of new modifications to the child theme without affecting your parent theme.
Child theme becomes a necessity if you continuously make changes to your theme. It is never too late to start utilizing the power of child theme. We hope the article helped you on how to create child theme from a modified existing theme.
Latest posts by Kantiman Bajracharya (see all)
- What are Different WordPress Theme Licensing Terms? - December 21, 2017
- 4 Tips to Optimize Your WordPress for Social Media Share - November 30, 2017
- What is WordPress? Is WordPress Free? Why is WordPress so popular? - November 22, 2017