cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Helper IV

Use a Child Theme when editing your theme's code

Here's a little WordPress Insider's tip. When you want to customize a theme which requires changing the code, you should always create a Child Theme. The Child Theme references the original theme (its Parent), but all the changes to the code are done inside the Child. That way when you update the Parent theme it doesn't overwrite all your changes.

Need some help with WordPress? Check out Site Doctor 911
Worry-Free WordPress Support - So You Can Focus On The Important Stuff
3 REPLIES 3
Former Employee

Yes, yes, yes 1000x yes. Child themes are the way to go. I started using them a while ago after seeing the article by Virginia Debolt referenced here: https://www.godaddy.com/garage/webpro/wordpress/sweet-child-theme-o-mine-creating-first-wordpress-ch...

 

Taking a few minutes to set up a child theme (instead of just hacking away in the original theme) is a great way to isolate the changes you're making from the base of the theme itself, and also prevents changes in the parent theme (e.g. during future updates of said parent theme) from blowing away all your modifications.

Heh. And...guess who has two thumbs and this past weekend went and clicked the button to do an auto-theme update to an old website, forgetting that he'd made changes in the base theme back in the olde days before he learned about child themes? #thisguy

 

"Dear Managed WordPress,

Thanks for doing automatic backups every day. 🙂

Sincerely,

Chris"

 

(I'll be moving those changes to a child theme this weekend.)

Kind of a long explanation coming here, I totally get why I want a child theme if I need to update code. I am a complete rookie when it comes to the code so bear with me. I am building a wordpress site and am using a purchased theme Magee Pro. I wanted to add the Woo Commerce plugin as I feel the plugin has a better store than what is provided in the theme and integrates the shopping cart ect. The documentation warned that it could have a problem displaying correctly in some themes and mine apparently is one of them. They have the code to fix the problem and suggest that it be done in a child theme. I downloaded another plugin Child Theme Configurator version 2.0.1 so that I could make the necessary changes unfortunately I get this message back when I use configurator : Notice: Undefined variable: align in /home/content/08/9552408/html/soultrek/wp-content/themes/magee/includes/magee-shortcodes.php on line 1909 and it warns I may not be able to create a child theme with the existing conditions. I have asked how to address this problem in creating the child theme on the Magee help forum (my theme was purchased long enough ago that it is no longer covered under the tech support I guess) and have not received a response. I am wondering if anyone here can help me get this issue resolved. Can I make the changes in the Custom CSS portion of the theme for the Woo Commerce display problems and will this work as well as changing the code inside the theme and not be affected by updates? If not what can I or should I do?