SlideShare a Scribd company logo
1 of 21
Daughter Themes

        (aka: Child-Themes)
And why you need to know about them
Why
 And


Ho
No theme will fit all sites
You can’t apply an update to a
theme without losing your
changes
Creating whole themes is hard
Daughter themes are easy
You can use framework themes
        to save effort
You can brand a theme for your client
The code needed
/*
Theme Name: You Company Theme.
Theme URI: http://bearne.ca
Author: Paul Bearne
Template: twentyeleven
Author URI: http://bearne.ca/
Description: This is the special theme I created just for your company’s
website.
Version: 1.0
License: GNU General Public License
License URI: license.txt
Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar,
right-sidebar, fixed-width, flexible-width, custom-background, custom-colors,
custom-header, custom-menu, editor-style, featured-image-header, featured-
images, full-width-template, microformats, post-formats, rtl-language-support,
sticky-post, theme-options, translation-ready
*/
@import url('../twentyeleven/style.css');
How to install it
 Save as style.css
 In a new folder called "theme-name" ... for example:
  " YourCompanyTheme"
 Create a zip of the folder - newTheme.zip (this zip
  needs a subfolder with the style.css in it )
 Upload it
Or FTP it
 Upload it to the Themes folder in a new folder
 which follows to show the theme folder as:
 YourCompanyTheme
Add a thumbnail
 Upload an image screenshot.png
Replacing template files
 Copy just the files from parent theme that you
  need to change to you daughter folder and edit
  them.
 WordPress looks in the daughter folder first and
  loads the file if found
functions.php
 WordPress will load BOTH function.php files
   child function.php then the parent function.php
 So you only need to add the extra/replacement
   functions
 Example:
<?php
add_action( 'after_setup_theme', 'CompanyNameTheme_setup' );
if ( ! function_exists( 'CompanyNameTheme_setup' ) ):
/**
 * Sets up theme defaults and registers support for various WordPress features.
 */
function CompanyNameTheme_setup() {
             // The default header text color
             define( 'HEADER_TEXTCOLOR', 'fff' );
             // By leaving empty, we allow for random image rotation.
             define( 'HEADER_IMAGE', '' );
}
endif; // CompanyNameTheme setup
Page Templates
 Custom layout for pages


 Good for Coming soon
 Landing pages
 Galleries etc.

<?php
/*
Template Name: Homepage
*/
?>
Template Hierarchy
If your blog is at http://example.com/blog/ and a visitor clicks on a
   link to a category page like
   http://example.com/blog/category/your-cat/
WordPress looks for a template file in the current Theme's
   directory that matches the category's ID.

 If the category's ID is 4, WordPress looks for a template file
  named category-4.php.
 If it is missing, WordPress next looks for a generic category
  template file, category.php.
 If this file does not exist either, WordPress looks for a generic
  archive template, archive.php.
 If it is missing as well, WordPress falls back on the main Theme
  template file, index.php.

                     http://codex.wordpress.org/Template_Hierarchy
Notes
 You can’t have a child of a child (1 layer only)
 There is a very small performance hit
Some links
 http://codex.wordpress.org/Child_Themes
 http://themeshaper.com/modify-wordpress-
  themes/
 http://wpfirstaid.com/2011/04/wordpress-child-
  themes/
 http://themeshaper.com/modify-wordpress-
  themes/




 @pbearne

More Related Content

What's hot

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themesDaisyOlsen
 
Wordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportWordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportJäck Davenpørt
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme developmentNaeem Junejo
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaTim Plummer
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migrationhenri_makembe
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureTim Plummer
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesDamien Carbery
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme developmenthenri_makembe
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designerselliotjaystocks
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in DrupalWingston
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep diveRomain Jarraud
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Word press templates
Word press templatesWord press templates
Word press templatesDan Phiffer
 
Demystifying drupal 7 theming
Demystifying drupal 7 themingDemystifying drupal 7 theming
Demystifying drupal 7 themingAnthony Ogbonna
 

What's hot (19)

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Wordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportWordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack Davenport
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme development
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with Joomla
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migration
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in future
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in Drupal
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Word press templates
Word press templatesWord press templates
Word press templates
 
Demystifying drupal 7 theming
Demystifying drupal 7 themingDemystifying drupal 7 theming
Demystifying drupal 7 theming
 
Drupal Theme Development
Drupal Theme DevelopmentDrupal Theme Development
Drupal Theme Development
 

Viewers also liked

Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisBrian Richards
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Themecertainstrings
 
WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011Dre Armeda
 
Supporting Wordpress
Supporting WordpressSupporting Wordpress
Supporting Wordpressmasonjames
 
Writing Your First Plugin - WordCamp Milwaukee 2012
Writing Your First Plugin - WordCamp Milwaukee 2012Writing Your First Plugin - WordCamp Milwaukee 2012
Writing Your First Plugin - WordCamp Milwaukee 2012bradparbs
 
Website Security - It Begins With Good Posture
Website Security - It Begins With Good PostureWebsite Security - It Begins With Good Posture
Website Security - It Begins With Good PostureTony Perez
 
What's the plan for your master brand?
What's the plan for your master brand?What's the plan for your master brand?
What's the plan for your master brand?Fly Solo Media Agency
 
Word Press Starter Kit: Widget & Plugin
Word Press Starter Kit: Widget  & PluginWord Press Starter Kit: Widget  & Plugin
Word Press Starter Kit: Widget & PluginGGDBologna
 
WordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sitesWordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sitesMichael McCallister
 
Optimizing WordPress Performance
Optimizing WordPress PerformanceOptimizing WordPress Performance
Optimizing WordPress PerformanceDouglas Yuen
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboySteve Mortiboy
 
WordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressWordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressmtoppa
 
WCBHAM: Running your Freelance Business
WCBHAM: Running your Freelance BusinessWCBHAM: Running your Freelance Business
WCBHAM: Running your Freelance Businesskellyhousholder
 
Acessibilidade Web agora é obrigatória. Estamos preparados?
Acessibilidade Web agora é obrigatória. Estamos preparados?Acessibilidade Web agora é obrigatória. Estamos preparados?
Acessibilidade Web agora é obrigatória. Estamos preparados?Hans Mösl
 
Zazzy WordPress Navigation WordCamp Milwaukee
Zazzy WordPress Navigation WordCamp MilwaukeeZazzy WordPress Navigation WordCamp Milwaukee
Zazzy WordPress Navigation WordCamp MilwaukeeRachel Baker
 
Using Theme Frameworks for rapid development and sustainability
Using Theme Frameworks for rapid development and sustainabilityUsing Theme Frameworks for rapid development and sustainability
Using Theme Frameworks for rapid development and sustainabilityJoel Norris
 
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingWordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingAaron Saray
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesDigitally
 
Money Making Blogs
Money Making BlogsMoney Making Blogs
Money Making BlogsChris Lema
 

Viewers also liked (20)

Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do This
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Theme
 
WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011
 
Supporting Wordpress
Supporting WordpressSupporting Wordpress
Supporting Wordpress
 
Writing Your First Plugin - WordCamp Milwaukee 2012
Writing Your First Plugin - WordCamp Milwaukee 2012Writing Your First Plugin - WordCamp Milwaukee 2012
Writing Your First Plugin - WordCamp Milwaukee 2012
 
Wcoc preso
Wcoc presoWcoc preso
Wcoc preso
 
Website Security - It Begins With Good Posture
Website Security - It Begins With Good PostureWebsite Security - It Begins With Good Posture
Website Security - It Begins With Good Posture
 
What's the plan for your master brand?
What's the plan for your master brand?What's the plan for your master brand?
What's the plan for your master brand?
 
Word Press Starter Kit: Widget & Plugin
Word Press Starter Kit: Widget  & PluginWord Press Starter Kit: Widget  & Plugin
Word Press Starter Kit: Widget & Plugin
 
WordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sitesWordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sites
 
Optimizing WordPress Performance
Optimizing WordPress PerformanceOptimizing WordPress Performance
Optimizing WordPress Performance
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve Mortiboy
 
WordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressWordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPress
 
WCBHAM: Running your Freelance Business
WCBHAM: Running your Freelance BusinessWCBHAM: Running your Freelance Business
WCBHAM: Running your Freelance Business
 
Acessibilidade Web agora é obrigatória. Estamos preparados?
Acessibilidade Web agora é obrigatória. Estamos preparados?Acessibilidade Web agora é obrigatória. Estamos preparados?
Acessibilidade Web agora é obrigatória. Estamos preparados?
 
Zazzy WordPress Navigation WordCamp Milwaukee
Zazzy WordPress Navigation WordCamp MilwaukeeZazzy WordPress Navigation WordCamp Milwaukee
Zazzy WordPress Navigation WordCamp Milwaukee
 
Using Theme Frameworks for rapid development and sustainability
Using Theme Frameworks for rapid development and sustainabilityUsing Theme Frameworks for rapid development and sustainability
Using Theme Frameworks for rapid development and sustainability
 
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingWordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress Themes
 
Money Making Blogs
Money Making BlogsMoney Making Blogs
Money Making Blogs
 

Similar to WortdPress Child themes: Why and How

2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-ThemesLightSpeed
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
advance theme development
advance theme developmentadvance theme development
advance theme development1amitgupta
 
Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Rakesh Kushwaha
 
Child themes
Child themesChild themes
Child themesbobwlsn
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress ThemesLaura Hartwig
 
Firstborn child theme word camp presentation - atlanta 2013
Firstborn child theme   word camp presentation - atlanta 2013Firstborn child theme   word camp presentation - atlanta 2013
Firstborn child theme word camp presentation - atlanta 2013Evan Mullins
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themesDaisyOlsen
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Paul Bearne
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Joe Querin
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25New Tricks
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopBrendan Sera-Shriar
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themesChris Olbekson
 
What is a theme
What is a themeWhat is a theme
What is a themeJinga Jung
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPressJeff Cohan
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3David Bisset
 

Similar to WortdPress Child themes: Why and How (20)

2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
advance theme development
advance theme developmentadvance theme development
advance theme development
 
Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality
 
Child themes
Child themesChild themes
Child themes
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress Themes
 
Firstborn child theme word camp presentation - atlanta 2013
Firstborn child theme   word camp presentation - atlanta 2013Firstborn child theme   word camp presentation - atlanta 2013
Firstborn child theme word camp presentation - atlanta 2013
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
W pthemes
W pthemesW pthemes
W pthemes
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute Workshop
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themes
 
What is a theme
What is a themeWhat is a theme
What is a theme
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 

More from Paul Bearne

Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp HamiltonPaul Bearne
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stackPaul Bearne
 
Unit tests with vagrant
Unit tests with vagrantUnit tests with vagrant
Unit tests with vagrantPaul Bearne
 
WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes Paul Bearne
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created itPaul Bearne
 
Author Avatars List demo slides
Author Avatars List demo slidesAuthor Avatars List demo slides
Author Avatars List demo slidesPaul Bearne
 

More from Paul Bearne (8)

WP json api
WP json apiWP json api
WP json api
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stack
 
Unit tests with vagrant
Unit tests with vagrantUnit tests with vagrant
Unit tests with vagrant
 
WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created it
 
Author Avatars List demo slides
Author Avatars List demo slidesAuthor Avatars List demo slides
Author Avatars List demo slides
 

WortdPress Child themes: Why and How

  • 1. Daughter Themes (aka: Child-Themes) And why you need to know about them
  • 3. No theme will fit all sites
  • 4. You can’t apply an update to a theme without losing your changes
  • 7. You can use framework themes to save effort
  • 8. You can brand a theme for your client
  • 9. The code needed /* Theme Name: You Company Theme. Theme URI: http://bearne.ca Author: Paul Bearne Template: twentyeleven Author URI: http://bearne.ca/ Description: This is the special theme I created just for your company’s website. Version: 1.0 License: GNU General Public License License URI: license.txt Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-width, flexible-width, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured- images, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready */ @import url('../twentyeleven/style.css');
  • 10. How to install it  Save as style.css  In a new folder called "theme-name" ... for example: " YourCompanyTheme"  Create a zip of the folder - newTheme.zip (this zip needs a subfolder with the style.css in it )  Upload it
  • 11. Or FTP it  Upload it to the Themes folder in a new folder which follows to show the theme folder as: YourCompanyTheme
  • 12.
  • 13. Add a thumbnail  Upload an image screenshot.png
  • 14.
  • 15. Replacing template files  Copy just the files from parent theme that you need to change to you daughter folder and edit them.  WordPress looks in the daughter folder first and loads the file if found
  • 16. functions.php  WordPress will load BOTH function.php files child function.php then the parent function.php  So you only need to add the extra/replacement functions  Example: <?php add_action( 'after_setup_theme', 'CompanyNameTheme_setup' ); if ( ! function_exists( 'CompanyNameTheme_setup' ) ): /** * Sets up theme defaults and registers support for various WordPress features. */ function CompanyNameTheme_setup() { // The default header text color define( 'HEADER_TEXTCOLOR', 'fff' ); // By leaving empty, we allow for random image rotation. define( 'HEADER_IMAGE', '' ); } endif; // CompanyNameTheme setup
  • 17. Page Templates  Custom layout for pages  Good for Coming soon  Landing pages  Galleries etc. <?php /* Template Name: Homepage */ ?>
  • 18. Template Hierarchy If your blog is at http://example.com/blog/ and a visitor clicks on a link to a category page like http://example.com/blog/category/your-cat/ WordPress looks for a template file in the current Theme's directory that matches the category's ID.  If the category's ID is 4, WordPress looks for a template file named category-4.php.  If it is missing, WordPress next looks for a generic category template file, category.php.  If this file does not exist either, WordPress looks for a generic archive template, archive.php.  If it is missing as well, WordPress falls back on the main Theme template file, index.php. http://codex.wordpress.org/Template_Hierarchy
  • 19.
  • 20. Notes  You can’t have a child of a child (1 layer only)  There is a very small performance hit
  • 21. Some links  http://codex.wordpress.org/Child_Themes  http://themeshaper.com/modify-wordpress- themes/  http://wpfirstaid.com/2011/04/wordpress-child- themes/  http://themeshaper.com/modify-wordpress- themes/  @pbearne

Editor's Notes

  1. there are always that little tweaks that will make jut right for you.
  2. If you edit the main theme, you will lose the edits if you update the theme following a version release
  3. there are always that little tweaks that will make jut right for you.
  4. there are always that little tweaks that will make jut right for you.
  5. there are always that little tweaks that will make jut right for you.