Blog Post: Child Themes Part 1

Red Deer & Blackfalds Web Design Writes:

In the world of WordPress Web Development there are various ways to find yourself with the same outcome. However, thinking long term (as you should with any Small Business ) you want to consider the fact that along the lines using a software such as WordPress that is controlled via an external source, the more customizations you have placed inside an existing Parent Theme (also commonly referred to as just a “Theme” or “Template Files”) the greater the likelihood that upon an update in the actual software (or an update of the Parent Theme) some of your customizations may break. Here are a few instances where this might happen:

  1. Custom PHP in Template.php Files – if you have taken the plunge and have actually done your own custom PHP/Javascript/HTML/CSS inside of the actual template files, upon update of the parent theme these will all be lost
  2. Updating the style.css File – let’s face the facts, to have any kind of customizations on a site (or to fix any existing bugs inside of a set of template files) you are going to add tens, hundreds, perhaps thousands of lines of CSS! But as soon as you update your theme files you lose every single line
  3. Theme Customs break on WP Update – WordPress is designed to update to make sites work better, right? But every so often when WordPress does an update it can break certain things on your site by overriding PHP, no longer recognizing certain CSS rules, breaking plugins, etc…

So what do you do to save yourself hours and hours of time when updating your Theme Files and Software? Use a Child Theme! This is done by by creating a small set of secondary files that “act” as your primary theme; however, they actually draw all the same information from your “Parent Theme Files”, except anything you write into your Child Theme Files will override existing structure in your Parent Theme. So essentially you could start a Child Theme, “call” all the same information from your Parent Theme, write ZERO lines of code in your Child Files, and your site would appear to just be using your Parent Theme! But every line of code you write in your Child Theme slowly but surely overrides the lines of code in your parent theme, AND! When you update the Parent Theme this happens in the “background” and thus your child files are not overridden and you don’t lose any of your customizations!

That’s a lot to take in … So! I have left the actual “nuts and bolts” of this article for Part 2!

Joshua Neufeld

Owner at Red Anchor Studio
At Red Anchor Studio we are dedicated to building local business! We offer high quality developments at an affordable price, and we can work to get your business online at any budget.

Latest posts by Joshua Neufeld (see all)