WordPress Child Theme Overview By Russell Fair for  Atlanta WordPress Developers and Designers Meetup Group  7.27.2011
Who's your (theme's) daddy?
Child Theme Basics <ul><li>What is a Child Theme?  </li></ul><ul><li>Why use Child Themes?  </li></ul><ul><li>Who should u...
What is a Child Theme? <ul><li>A Child Theme is a WordPress theme that relies on another theme (its parent theme) to provi...
Why Use a Child Theme? <ul><li>Using a Child Theme allow you to update the parent theme easily without over-writing your c...
Who should use a Child Theme? <ul><li>Everyone!  According to WP Codex, Child theme is the recommended way to customize </...
How do Child Themes Work? <ul><li>When WordPress is looping through the theme directory, it will try to match the request ...
 
How do I make a Child Theme? <ul><li>Step 1: Create a directory in your wp-content/themes directory for your theme (sub-di...
Making a Child Theme <ul><li>Step 2: Create a valid stylesheet with comment block. </li></ul><ul><li>Add Template: [parent...
Optional: Add custom theme files <ul><li>Functions.php </li></ul><ul><li>Your sidebars, header or footer </li></ul><ul><li...
Child Theme Advanced Topics <ul><li>Child Theme Functions </li></ul><ul><ul><li>Pluggable Functions </li></ul></ul><ul><ul...
Child Theme Functions (pluggable) <ul><li>There are two types of functions that your child theme can access, the first is ...
Child Theme Functions  (hooked) <ul><li>Non Pluggable functions should be hooked using action hooks </li></ul><ul><li>You ...
Parent Theme Frameworks <ul><li>Listed on WP Codex  http://codex.wordpress.org/Theme_Frameworks </li></ul><ul><li>Thematic...
Notes about Child Themes <ul><li>Child themes may not be uploaded to WordPress.com or the WordPress.org theme repository (...
Child Theme Resources <ul><li>http://codex.wordpress.org/Child_Themes </li></ul><ul><li>http://op111.net/53/ </li></ul><ul...
Upcoming SlideShare
Loading in...5
×

WordPress Child Themes

3,256

Published on

Published in: Technology, Business
1 Comment
2 Likes
Statistics
Notes
  • very good slides, thanks Russell!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
3,256
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

WordPress Child Themes

  1. 1. WordPress Child Theme Overview By Russell Fair for Atlanta WordPress Developers and Designers Meetup Group 7.27.2011
  2. 2. Who's your (theme's) daddy?
  3. 3. Child Theme Basics <ul><li>What is a Child Theme? </li></ul><ul><li>Why use Child Themes? </li></ul><ul><li>Who should use Child Themes? </li></ul><ul><li>How do Child Themes Work? </li></ul><ul><li>How do I make a Child Theme? </li></ul>
  4. 4. What is a Child Theme? <ul><li>A Child Theme is a WordPress theme that relies on another theme (its parent theme) to provide some or all of the structure. </li></ul><ul><li>A child theme MUST have at least a stylesheet with an appropriate comment block (See style.css in WordPress theme Hierarchy) </li></ul><ul><li>When loading, a child theme will look to it's parent for files that it can not provide on its own </li></ul><ul><li>Circa WordPress version 2.7 </li></ul>
  5. 5. Why Use a Child Theme? <ul><li>Using a Child Theme allow you to update the parent theme easily without over-writing your customizations. </li></ul><ul><li>If you offer themes as a service, parent themes allow you to have a streamlined, unified architecture and development process. </li></ul><ul><li>WordPress MultiSite users – using child themes to create many “similar” themes with common architecture, but some differences, and ability to share more resources. </li></ul>
  6. 6. Who should use a Child Theme? <ul><li>Everyone! According to WP Codex, Child theme is the recommended way to customize </li></ul><ul><li>Web design companies who maintain their themes and want to streamline processes. </li></ul><ul><li>Multi-site users/admins </li></ul><ul><li>Theme Authors who want to sell their themes in theme marketplaces </li></ul>
  7. 7. How do Child Themes Work? <ul><li>When WordPress is looping through the theme directory, it will try to match the request (query) with the right template file to use (e.g. page.php, single.php, archive.php, etc.) </li></ul><ul><li>If it can not find the right template file in the child theme directory, it will scan the parent theme directory for the file. Works for get_template_part! </li></ul><ul><li>Child themes are like Teenagers. If they have their own money, they will spend it; if they don't have their own money, they will get it from their parents. </li></ul>
  8. 9. How do I make a Child Theme? <ul><li>Step 1: Create a directory in your wp-content/themes directory for your theme (sub-directories not a good idea). Don't use spaces or special symbols. </li></ul>
  9. 10. Making a Child Theme <ul><li>Step 2: Create a valid stylesheet with comment block. </li></ul><ul><li>Add Template: [parent-theme-directory] to the comment block to specify the parent theme. </li></ul>
  10. 11. Optional: Add custom theme files <ul><li>Functions.php </li></ul><ul><li>Your sidebars, header or footer </li></ul><ul><li>Other template parts such as comments or nav menus </li></ul><ul><li>Custom post type archives </li></ul><ul><li>Custom taxonomy archives </li></ul><ul><li>Page templates </li></ul><ul><li>Other WordPress theme files </li></ul>
  11. 12. Child Theme Advanced Topics <ul><li>Child Theme Functions </li></ul><ul><ul><li>Pluggable Functions </li></ul></ul><ul><ul><li>Hooked Functions </li></ul></ul><ul><ul><li>Filters </li></ul></ul><ul><li>Notes About Child Themes </li></ul><ul><li>Parent Themes (frameworks) </li></ul><ul><li>Child Theme Resources </li></ul>
  12. 13. Child Theme Functions (pluggable) <ul><li>There are two types of functions that your child theme can access, the first is a pluggable function. </li></ul><ul><li>Pluggable functions are not just for themes. </li></ul><ul><li>Pluggable function example from twentyeleven </li></ul><ul><li>if ( ! function_exists( 'twentyeleven_setup' ) ): </li></ul><ul><li>To override the twentyeleven setup just write your own twentyeleven_setup function in your child functions.php file. </li></ul>
  13. 14. Child Theme Functions (hooked) <ul><li>Non Pluggable functions should be hooked using action hooks </li></ul><ul><li>You can easily remove functions created by the parent theme, and supplement them with your child theme functions </li></ul><ul><li>remove_action( 'init', 'hybrid_register_menus' ); </li></ul><ul><li>add_action( 'init', 'mychild_register_menus' ); </li></ul>
  14. 15. Parent Theme Frameworks <ul><li>Listed on WP Codex http://codex.wordpress.org/Theme_Frameworks </li></ul><ul><li>Thematic Theme (free, developer friendly) http://themeshaper.com/thematic-for-wordpress/ </li></ul><ul><li>Hybrid Theme (free, paid support) http://themehybrid.com/ </li></ul><ul><li>Genesis Theme (premium, regular updates, developer friendly) http://www.studiopress.com/themes </li></ul><ul><li>Thesis Theme (premium, regular updates, highly customizable) http://diythemes.com/ </li></ul>
  15. 16. Notes about Child Themes <ul><li>Child themes may not be uploaded to WordPress.com or the WordPress.org theme repository (yet, as far as I know). </li></ul><ul><li>You CAN make 2nd, and 3 rd level deep child themes (grand-child and great-grand-child) but DON'T. </li></ul><ul><li>Never, ever, ever modify the parent theme without thorough testing when one or more child themes rely on it (yes even updates). </li></ul>
  16. 17. Child Theme Resources <ul><li>http://codex.wordpress.org/Child_Themes </li></ul><ul><li>http://op111.net/53/ </li></ul><ul><li>http://php.quicoto.com/wordpress-theme-hierarchy/ </li></ul><ul><li>http://codex.wordpress.org/Theme_Development </li></ul><ul><li>http://themehybrid.com/hybrid-core </li></ul><ul><li>http://lorelle.wordpress.com/2008/12/30/parentchild-themes-in-wordpress-the-future-of-wordpress-themes/ </li></ul><ul><li>http://wpcandy.com/uncategorized/frameworks-child-themes-filters-and-hook </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×