Building Child Themes

The smart way to develop WordPress themes

WordCamp Portland 2010

Any Theme can be a parent

And you can do it with your hands

What Are Child Themes?

File Structure

style.css


/*
Theme Name: Thirty Ten
Theme URI: http://aaron.jorb.in/thirty-ten
Description: A child theme of 2010.
Author: Aaron Jorbin based on work by the WordPress team
Author URI: http://aaron.jorb.in/
Version: 1.1
Template: twentyten
*/

@import url('../twentyten/style.css');
		

Same as a regular theme, except we define a Template (which is the Parent's Directory) and then import the parents style sheet

Why Use Child Themes

Examples

Twenty Ten

Template Hierarchy

Codex Article

get_template_part

Play to your strengths

PHP?
Use a framework like Thematic (Over 150 hooks)
CSS?
Choose a theme that has every element you need
Javascript?
Do Magic
Rich?
Hire someone who knows what they are doing

Let's Build a Child Theme

Rules:

Final Tips