944 VIEWS

WordPress tricks #5: protecting your theme with a child theme

BYLi Du
October 22, 2014

 child theme 640x320

WordPress has many awesome themes. Before you dive into them, you’d better think about long-term effects. Here is a scenario. Someday, a new and improved version of the theme you are going to use on your site is released by the person who created it. Here is the issue: if you update the theme with the new version, you wipe out all the edits and changes you made to your old version theme. Then you have to edit it over and over again whenever a new version of the theme is released.

Fortunately, WordPress provides a solution. WordPress has an amazing theme-development technique known as child themes. When you create a child theme, your current theme (or “parent” theme) will be regarded as a starting point. Your edits and changes in your child theme can override the styling of your current theme. In this way, when you install an update for your current theme, your altered files in the child theme folder will remain unchanged.

You’d better start by creating a child theme if you wan to customize your theme. However, if you want to create a completely new theme on your own, then you don’t need to bother to create a child theme.

To create a child theme, you just simply create a folder (name the folder whatever you want) in your wp-content/themes directory. Then create a single style.css file within that folder.

For example, if your current theme is Twenty Fourteen, then place the following codes in your style.css file you just created in your child theme.


/*
Theme Name: child theme of Twenty Fourteen
Description: This is a customized version of the Twenty Fourteen
Author: your name
Template: Twenty Fourteen
(optional values you can add: Theme URI, Author URI, Version)
*/
@import url("../twentyfourteen/style.css");

The most important line is the “Template: Twenty Fourteen” line, because it indicates the folder of the parent theme. The last line imports the stylesheet from your parent theme.

Li Du

BY

Building and running First Site Solutions make my dream come true! Over the years of pursuing my dream, I saw the amazing opportunities in online business world, acquired valuable experience and a great wealth of skills and knowledge on building, growing and developing a business online.

I am growing with my company and in the field of my interest. We are turning our website into an online business platform and community where you can start and grow your own business too!

When I endeavored to develop our business with my passion and faith, I wanted to share all I've learned (good and bad) with you, and wish that it can benefit you and your business, help you find what you need to reach your business goals and achieve your successes.

get our free ebook

free ebook download

conversion rate optimization

the way to increase your online sales!

download now

Download Free E-book

Conversion Rate Optimization – The Way to Increase Your Online Sales


Sign up to get instant access to my ultimate guide to successful Conversion Rate Optimization and keep updated on our actionable tips plus exclusive deals!