How To Create A Child Theme

Why it is Important to work in Child Theme

Child themes allow you to make changes without affecting the original theme’s code, which makes it easy to update your parent theme without erasing your changes. By creating a child theme, you create a separate set of files that you can use to customize the theme without affecting the original theme at all. Not only does this make updating easier, it also makes sure that you will never ruin your original theme as you are never actually modifying the files. You can always turn off your child theme and fall back on the original.

In this example, we will be creating a child theme for our twentytwelve theme. First things first, we need to create a new folder for your child theme. Naming it something like /twentytwelve-child/ is conventional. Within your new theme folder, create a file called style.css and fill in the information as outlined below. The theme Name, URI, Description and Author are totally up to you.

Getting Started

/*
 Theme Name:   Twentytwelve Child
 Theme URI:    http://example.com/twentytwelve-child/
 Description:  Twenty Twelve Child Theme
 Author:       Type Your Name
 Author URI:   http://example.com
 Template:     twentytwelve
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twentytwelve-child
*/

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

/* =Theme customization starts here
-------------------------------------------------------------- */

The most important parts of this file are the “Template:

Activating Your Child Theme

Appearances > Themes page in your WordPress Dashboard and activate it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s