Kathryn Presner
WordCamp Montreal 2014
@zoonini
#wcmtl	
  
Kathryn Presner
Happiness Engineer
Automattic Theme Team
https://www.flickr.com/photos/ben124/5396260658
https://www.flickr.com/photos/sackton/8258253775/
Brownies
Cream butter and sugar.
Beat in eggs and vanilla.
Add dry ingredients.
Spread in pan, bake at
350F for 30 min.
1 cup sugar
½ cup butter
2 eggs
1 tsp vanilla
1 cup flour
¼ cup cocoa
½ tsp. salt
Child theme = recipe variation
https://www.flickr.com/photos/snekse/399462304
Brownie Variations
Blondies
+ brown sugar - white sugar
Mint brownies
+ add mint extract - vanilla
Nutty brownies
+ nuts
Double chocolate mini muffins
+ choc. chips +bake in mini-muffin tin
https://www.flickr.com/photos/handcoding/2117794703
Parent Theme
!=
Starter Theme
Why?
Why?
Faster development
Why?
Benefit from others' design, coding
Why?
Safer updates
Why not?
Why not?
Untangling others' code
Why not?
Can feel hacky
Why not?
Can be inefficient
http://wordpress.org/themes/
Sorbet
One-minute
child theme setup
For reals!
Setup
parent
Setup
parent
child
Setup
parent
child
Setup
parent
child
Setup
required file
style.css
style.css
Activate child theme
Import parent styles
in style.css
(or) Enqueue styles
in functions.php
https://www.flickr.com/photos/47741487@N06/7994654729
https://www.flickr.com/photos/healthcare4every1/3743271846
Template files
YES
Use child's file
NO
Use parent's file
Does template file exist in child theme?
and
so
on
...
content.php
content.php
content.php in parent
content.php in child
https://codex.wordpress.org/Post_Formats#Using_Formats
Create custom template
http://codex.wordpress.org/Page_Templates#Creating_a_Page_Template
https://www.flickr.com/photos/stefz/2159280574
Functions – loading order
1. Child's functions.php loaded
2. Parent's functions.php loaded
Duplicate functions
Hooks, actions, filters
https://www.flickr.com/photos/bonitoclub/7959426472
Remember this?
https://www.flickr.com/photos/nationalzoo/4368143044
Grandchild
themes?
https://www.flickr.com/photos/nationalzoo/4368143044
Resources
Child Themes – Codex
https://codex.wordpress.org/Child_Themes
Conditional Tags – Codex
http://codex.wordpress.org/Conditional_Tags
Functions – Codex
https://codex.wordpress.org/Function_Reference/
Resources
ThemeShaper
http://themeshaper.com
Replacing a filter in a Twenty Twelve Child
Theme
http://mikelittle.org/replacing-a-filter-in-a-twenty-twelve-
child-theme/
Creating Grandchild Themes
http://docs.appthemes.com/tutorials/creating-grandchild-
themes/
Credits
Presentation 
slideshare.net/zoonini
Kathryn Presner 
kpresner.com / Twitter: @zoonini
Fonts 
Arvo & Lato
Photos
Flickr – Creative Commons
Cat photos – K. "Crazy Cat Lady" Presner

Getting Comfortable With Child Themes - WordCamp Montreal