Be the first to write a review
Building a Child Theme from a Child Theme in WordPress
How to accomplish this small feat, which is very similar to building a child theme from scratch
You already may have child themes down and you've built a few from some WordPress themes. But, have you thought about building a child theme from another child theme? In this article, Linda shows how to accomplish this small feat, which is very similar to building a child theme from scratch.
First Steps
If you want to create a child theme, no matter if it is a child of an original or another child theme, you need to create a new folder on your hard drive for that child theme. I've created a new folder called "hybrid-news-custom" and I copied all the files from the Hybrid News theme into that folder. Then, I uploaded that folder to the site and placed it with the other themes in the "WP-content/themes" folder online.
If you do the same actions as I did, you may freak out because you will see two themes for Hybrid News (or for whatever other theme that you are using to create a child theme). Don't freak, as this problem (as shown in the image below) will resolve itself once you make changes to the top of the CSS file that you will upload next.
Note the two Hybrid News Themes shown above, with the Hybrid
0.7 as the current theme in top left.
Changing the Hybrid News CSS Header
The next step in making your child theme from a child theme is to find the CSS file in your NEW folder (mine being the "hybrid-news-custom" folder). This file is named, simply, "style.css". Open that file in Dreamweaver or in an HTML editor, and you'll see the following header:
/**
* Theme Name: Hybrid News
* Theme URI: http://themehybrid.com/themes/hybrid-news
* Description: A news-style child theme of the Hybrid theme framework.
* Version: 0.2
* Author: Justin Tadlock
* Author URI: http://justintadlock.com
* Tags: blue, theme-options, threaded-comments, sticky-post, microformats, two-columns, three-columns, fixed-width
* Template: hybrid
*
* Copyright (c) 2008 Justin Tadlock. All rights reserved.
* http://justintadlock.com
*
* Hybrid News is released under the GNU General Public License, version 2 (GPL).
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
You'll need to make the following changes, highlighted for easy work:
/**
* Theme Name: Hybrid News Custom
* Theme URI: http://themehybrid.com/themes/hybrid-news
* Description: A news-style child theme of the Hybrid News theme framework, based upon the Hybrid theme.
* Version: 0.2
* Author: [Your Name]
* Author URI: [Your Web site]
* Tags: [Pick tags that describe your theme. If you don't have a clue, then wait to fill this in later]
* Template: hybrid
*
* Copyright (c) 2010 [Your Name]. All rights reserved.
* [Your URL]
*
* Hybrid News Custom is released under the GNU General Public License, version 2 (GPL).
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
NOTE that I did NOT change the template information shown above under the 'tags' line. The reason behind keeping this information the same is that Hybrid News is based upon Hybrid; therefore, Hybrid News does not contain a template nor a stylesheet that will allow your new theme to show in the WP dashboard themes page. The only way your new child theme will work if it, also, is based upon Hybrid – even if it is a child of a child.
Therefore, you must always have your parent theme, no matter the theme, uploaded in the themes folder for any child theme to work. Your child themes, even if they are based upon another child theme, will need that original parent theme to function. Here's the theory behind the child of a child in graphic form:
You are creating a child of a child in your themes, but you
are NOT creating a child from that child in the template portion – a child,
after all, should not be a parent. You merely copied all the child theme files
to another folder with another name (no matter the original theme), but you
continue to base your child-of-a-child on the parent. In other words, you are
creating a twin of the original child theme.
Once you make those changes and upload the altered CSS file to your new child folder, you will see something like this in your WP themes folder in your WP dashboard:
Now the Hybrid News Custom, created by me, shows in the middle bottom row. At this point, I can make any changes I want to the Hybrid News them without touching the original Hybrid News theme files. This way, if I screw up (and I inevitably do...), I can copy the original file or files and transfer them to my new folder to begin again.
Linda Goin
Linda Goin carries an A.A. in graphic design, a B.F.A. in visual communications with a minor in business and marketing and an M.A. in American History with a minor in the Reformation. While the latter degree doesn't seem to fit with the first two educational experiences, Linda used her 25-year design expertise on archaeological digs and in the study of material culture. Now she uses her education and experiences in social media experiments.
Accolades for her work include fifteen first-place Colorado Press Association awards, numerous fine art and graphic design awards, and interviews about content development with The Wall St. Journal, Chicago Tribune, Psychology Today, and L.A. Times.