WordPress

How a WordPress Child Theme May Save Your Business Some Day

Imagine tweaking your WordPress theme for hours, aligning those images, increasing line height so text is easier to read, setting that call-to-action button color, making featured images bigger… Weeks later you see there’s an update for your theme. You hit that Update button and BAM, your site’s a soup. Things are misaligned, sidebars look awful, images overlap, everything’s a mess.

If you’re using WordPress as your CMS of choice, it’s important to allow the parent theme to be updated easily without compromising your website looks and functionality. Creating a child theme is the easiest way of modifying your WordPress theme. But, not everyone needs a child theme. If you’re running a custom WordPress website, then you probably don’t need a child theme and all changes should be dealt by the developers.

Public WordPress templates, on the other hand, get bug fix updates and other upgrades, so your site may not look the same when you hit that “update theme” button. WordPress best practices suggest you should never modify the theme files directly. Or you can create a child theme. A child theme inherits all the genes from its parent, but still allows you to override them in terms of functionality and styling.

Pros of Using Child Themes

Everything has an upside and a downside and child themes are no different. The only downside of using a child theme is it may take a couple of minutes to create one, but you get much more for the time you invest:

Parent is always your fallback

Working with WordPress child themes is safe, because you have a parent to rely on. Should you do something wrong, miss a line of code or don’t like how it turned out, you can always fall back to the original.

Life doesn’t grant you with the luxury of choosing your parents, but WordPress does. While it’s easy to edit the look of the parent theme using child themes, be sure to do your research and choose parents wisely. Default WordPress themes are always a good starting point: Twenty Eleven, Twenty Twelve or Twenty Thirteen.

Updating without worrying

“A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme.” ~WordPress Codex.Your child theme holds all the custom changes you’ve made, so updating its parent theme should be pretty secure. You’ll minimize the chance of ending up with weird styling after hitting “update theme”.

The modifications you’ve made are safely stored within your child theme, so it’s similar to creating a backup of your website.

Extensibility – Style & Functions

If you choose a good parent theme with a solid framework, you have a lot of flexibility without writing tons of code. You’ll only need to modify just a few lines of CSS to get what you want. It radically decreases the development time and this may be a good opportunity for you to learn a couple of WordPress tricks.

How to Create a WordPress Child Theme

If you’re willing to give it a try, there are two ways you can create a child theme and both are pretty simple. One involves plugins that automatically create child themes for you and the other method is to do it manually.

Use Plugins

wordpress extendebility child theme How a WordPress Child Theme May Save Your Business Some DayThere are several plugins you can find in the WordPress plugin repository:

The method where you use plugins is convenient, but you don’t get all the control. It will work for most beginners and businesses that don’t want to spend too much time dealing with child themes and customization.

Use Child Themes Manually

If you decide to manually create a child theme, just follow the list below.

  1. Create a directory in your wp-content/themes/ directory to hold the child theme. Don’t use spaces when naming the folder.
  2. In the child theme directory, create a file called style.css. This is the only file required to make a child theme.Here’s an example for Holi – Twenty Thirteen’s Multi Colored Child Theme. The style sheet starts with the following lines:
@import url("../twentythirteen/style.css");
/*
Theme Name:		Holi
Theme URI:		http://thematosoup.com/products/twenty-thirteen-multi-colored/
Description:	        Multicolor child theme for the Twenty Thirteen theme 
Author:			ThematoSoup
Author URI:		http://thematosoup.com
Template:		twentythirteen
Tags:			blue, gray, green, yellow, pink, purple, red, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Version:		1.0.4

This theme and all bundled resources, like WordPress, are licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.

Header/BG Images License
Author:			Slobodan Manic ​http://thematosoup.com
License:		GPLv2
*/

You are allowed to change any of these lines as you see fit. The two mandatory ones are Theme Name and Template, which is the directory name of your parent theme.

In the case above, the parent theme is the TwentyThirteen theme, so the Template is twentythirteen, which is the name of the directory where the TwentyThirteen theme is located.

If you don’t import parent’s stylesheet (style.css) which is done by this line:

@import url("../twentythirteen/style.css");

you’ll erase the identity completely, but we don’t want to do that – we want only to make a few adjustments. This “gene import” must be before any additional CSS you wish to include.

You can then activate your child theme in Appearance > Themes.

How to Change More than just the Visuals

Want to alter more than just the looks? Just copy the file you want to edit in your child theme. So, you can for instance take header.php from the parent to the child and edit it there.

For more information on how to do edit theme files, deal with localization, functions.php and other stuff only developers will need, take a look at the WordPress Codex on Child Theming


For end users, the biggest benefit of using child themes is that updating the parent theme almost never results in unexpected malfunctions. Also, all customization work is safely preserved.

WordPress Best Practices suggest that themes and plugins extend WordPress by overriding its core. Child themes are no different, so use them whenever you can and make your WordPress based business more secure, easier to maintain and extend.

 How a WordPress Child Theme May Save Your Business Some Day

Dragan Nikolic

Blogger for hire at Dragan Nikolic
I'm a co-founder of ThematoSoup and a blogger for hire. Get in touch with me through my personal website at http://dragannikolic.com or via any of the social networks.
 How a WordPress Child Theme May Save Your Business Some Day

Comments are closed.

16 thoughts on “How a WordPress Child Theme May Save Your Business Some Day

  1. Child themes are the only way to go. I use Genesis from Studiopress and it makes life so much better as all the heavy lifting has been done for you plus the parent theme is fully optimised for SEO.

  2. Hi Dragan,

    Your article is really helpful, thanks for writing. I am looking forward to read more articles in future. Keep writing!!! cheers.

  3. I couldn’t agree more! I make WordPress themes and sometimes I see web designers modifying a theme for a client without using a child theme. This is bad news for the client down the road. Everybody who builds sites using third party WordPress themes needs to know about child theming.

    1. Steven, thanks for joining the discussion.

      You’re right, many developers don’t take advantage of child themes and end-users suffer. So, it’s important we make everybody aware of WordPress child themes and how (why) they should use them.

  4. I’m new to wordpress, but have finally managed to get my site exactly how I wanted it. BUT, now I get this message that I have a new update for my theme so I did a little research about the safest way to update a theme and now I am learning all about the child theme and I fear that it is too late.

    I found this plugin that makes creating a child theme simple and I am going to give it a try http://wordpress.org/plugins/child-themify/installation/ BUT i still am nervous that it is too late to even create a child theme after making changes on the parent theme.

    Hope to hear your thoughts soon! Thanks in advance

    1. Rachael,

      Is there a chance you could ask your developer to save all the changes she/he made and transfer them to the child theme?

      Before you do anything, you should create a backup of your website.

      1. Thanks for the fast response. So I took your advice, backed everything up and saved it. I had Child Themify plugin and decided to change it to One click child theme and when I went to click “create child theme” that’s when everything just blew up. And now my website reads:

        Warning: require_once(/home1/adamsr/public_html/wp-content/themes/my-first-child-1011/aletheme/init.php) [function.require-once]: failed to open stream: No such file or directory in /home1/adamsr/public_html/wp-content/themes/socha/functions.php on line 14

        Fatal error: require_once() [function.require]: Failed opening required ‘/home1/adamsr/public_html/wp-content/themes/my-first-child-1011/aletheme/init.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home1/adamsr/public_html/wp-content/themes/socha/functions.php on line 14

        http://www.rachadams.com

        I don’t even know how to go in and access anything. I can’t even get past this wording to my writing. And here is no developer, it’s just me.

        Before I downloaded the new plugin I had deactivated the old but maybe I should have deleted the whole plugin itself, I’m not sure.

        Trying to stay calm, but I don’t know where to go from here. Thanks for the advice.

    2. Glad you got it to work again.

      It’s always best to ask someone who’s done this before to assist you (a developer). If you experience any other issues where you can’t access the dashboard, it’s best to contact your hosting company (it’s what they’re paid for) and ask them to fix it.

      Sorry if my post got you into trouble. It was never my intention.