Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012

Post on 08-May-2015

797 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

If you've been building WordPress websites for a while you may already be familiar with Child Themes.  They are the recommended way of making modifications to an existing theme. Chris shows us the basics of Child Theming, including the why it is so recommended and how to actually make your first WordPress Child Theme.

Transcript

Photo by Garreth Wicock - http://www.flickr.com/photos/gjmj/

Photo by Thomas Hawk - http://www.flickr.com/photos/thomashawk/

“child themes are the recommended way

of making modifications to a theme”

Source: http://codex.wordpress.org/Child_Themes

• Changing favicon

• Changing logo / banner

• Adding additional components (e.g. bbPress)

• Changing colour scheme

wp-content

themes

twentyeleven

wcsyd

wp-content

themes

twentyeleven

wcsyd

wcsyd-child

themes

twentyeleven

wcsyd

wcsyd-child

style.css

“style.css is the one and only required file in a

child theme. It replaces the style.css of the

parent.”

Source: http://codex.wordpress.org/Child_Themes

/*

Theme Name: WCSyd Child

Template: wcsyd

*/

“It replaces the style.css of the

parent.”

Source: http://codex.wordpress.org/Child_Themes

/*

Theme Name: WCSyd Child

Template: wcsyd

*/

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

wcsyd

wcsyd-child

single.php

single.php

wcsyd

wcsyd-child

archive.php

archive.php

The functions.php is loaded in addition to the parent’s

functions.php. (Specifically, it is loaded right

before the parent’s file.)

Source: http://codex.wordpress.org/Child_Themes

wcsyd-child

wcsyd

functions.php

functions.php

• do_action()

• apply_filters()

• get_template_part()

• function_exists()

• require_once()

• include_once()

• !important (css)

*May be suitable in

certain circumstance

top related