Child Themes- Making Changes to a Theme While Allowing for Updates

When working with Elegant Themes, I have found it necessary to edit the code (mostly style.css) to get the theme to look right for my client. Upon updating the theme, these changes disappear, so it becomes necessary to manually edit the code again. If I didn’t keep notes on these changes, I would be in big trouble!

However I have discovered an easier way to make changes to a theme without disturbing the integrity of the theme- Using Child Themes allows you to make changes to the theme while allowing updates.

What is a Child Theme?

Child Themes are created by a FTP program and a Text Editor. I work on a Mac so I used Transmit for the FTP program and Text Wrangler for the Text Editor. Transmit is a reasonably priced and highly rated FTP program. Text Wrangler is a free program from the App Store and highly rated by users.

How to Create a Child Theme?

In the FTP program, go to the themes for your site, and add a new folder. Title it the name of the original theme-child or something close to this so you can recognize it easier.

Add a file and title it style.css. Open this file in the Text Editor. Add these lines of text and fill in the appropriate spaces. These lines of coding allow your new child theme to refer all coding from the parent theme, and allows you to put your changes after it.

/*
Theme Name: YOUR THEME Child Theme
Version: 1.0
Description: A child theme for YOUR THEME.
Author:
Author URL: http://www.yourURL.com
Template:
*/

@import url(“../YOUR THEME/style.css”);

Now you may add the rest of your changes to the end of this line.

 

Making Internal Theme Changes

For some themes in Elegant Themes, the footer and header (or other files) will need to be changed. These changes are not ones that can be added to the end of style.css. They can be a change in font size or color.  In these cases, you will need to make a new file, titled footer.php and another header.php.

Copy all the original code from the footer.php file and paste into the new file in the child theme. Find the line you need, make the appropriate changes and save.

When you activate the new child theme, it should have all your changes without interfering with future theme and wordpress updates. As a side note, the new child theme in wordpress will not show the image of the theme. That is ok, don’t worry, the theme still works.