SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
WordPress Child Themes
       by Alison Foxall, Designer & Partner @ Gobble Logic



                                                   @alisonmf
                                         www.alisonfoxall.com
                                                 @gobblelogic
                                         www.gobblelogic.com
By Definition


Child Theme
  A theme that inherits the functionality of another theme, called
  the parent theme, and allows you to modify, or add to, the
  functionality of that parent theme.

  Translation: A theme for a theme
Key Benefits
Protect your changes (from upgrading a parent theme)
   i.e. You change the Twenty Eleven Theme around to better suit your
   needs, but Oh! Look! WordPress wants to upgrade some things. You
   get on a click-happy upgrade frenzy, and accidentally upgrade your
   Twenty Eleven Theme to the newest version, and overwriting
   everything you have worked for. You can avoid this heart-sinking
   catastrophe by creating a Child Theme for Twenty Eleven instead.

Additional Functionality (cooler features)
   i.e. Someone (or you) could make a theme that just does more for
   you in terms of functionality, with the same look and feel of Twenty
   Eleven. Creating this Child Theme would enable you to keep these
   features without them getting overwritten.
Remember!


Child Themes Should...
  Realistically a child theme should be nothing more than a stylesheet
  and some additional functions. Nothing crazy. Too much, and you
  should be making a parent theme, otherwise problems can occur
  with upgradability.
Creating a Child Theme
 Directory Hierarchy
   Child Themes reside in the same folder as the ‘themes’ folder. It
   does NOT reside in the parent theme folder. e.g.

   themes
       twentyeleven
       twentyeleven-mychild
       twentyten

 Style.css
   This is needed in the folder to actually create a theme
Style.css
  Carry on as normal except...
     As with any WordPress theme, the information header must be at
     the top of the file, the only difference being that in a child theme
     the Template: line is required, so that WordPress knows which
     theme is the parent of the child theme. It should be the directory
     name of the folder, case sensitive.
/*
Theme Name:         Twenty Eleven Child
Theme URI:          http://example.com/
Description:        Child theme for the Twenty Eleven theme
Author:             Your name here
Author URI:         http://example.com/about/
Template:           twentyeleven
Version:            0.1.0
*/
Noted
Overrides
  Your new style.css will OVERRIDE the parent style.css. With this in
  mind, @import your parent stylesheet and then start making your
  changes. You do not need to use the !important declaration.

Other Paths
  Lesson Learned: Don’t use bloginfo(stylesheet_directory) in your
  parent themes when linking to files.

  Instead, use something like this to obtain a uri path for javascript
  libraries, css, and other paths in your template files:
  echo get_template_directory_uri()
Demo Time!
Thank You!
afox@gobblelogic.com
@alisonmf

@tampabaywp
tampabaywp.com

Contenu connexe

Tendances

The Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child ThemesThe Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child ThemesAnthony Hortin
 
What Is WordPress and Why Is Everyone Talking About It?
What Is WordPress and Why Is Everyone Talking About It?What Is WordPress and Why Is Everyone Talking About It?
What Is WordPress and Why Is Everyone Talking About It?BobWP.com
 
Birthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonBirthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonLauren Pittenger
 
Getting into WordPress Front End Development
Getting into WordPress Front End DevelopmentGetting into WordPress Front End Development
Getting into WordPress Front End DevelopmentDenise (Dee) Teal
 
Child Theming: An Introduction to Wordpress Theme Development with Wordpres...
Child Theming: An Introduction to  Wordpress Theme Development  with Wordpres...Child Theming: An Introduction to  Wordpress Theme Development  with Wordpres...
Child Theming: An Introduction to Wordpress Theme Development with Wordpres...Aban Nesta
 
Intro to StudioPress child themes
Intro to StudioPress child themesIntro to StudioPress child themes
Intro to StudioPress child themesvegasgeek
 
Intro to WordPress Child Themes (NERDS Sept 2014)
Intro to WordPress Child Themes (NERDS Sept 2014)Intro to WordPress Child Themes (NERDS Sept 2014)
Intro to WordPress Child Themes (NERDS Sept 2014)Kelly Dwan
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesEric Sembrat
 
How to Start a WordPress Blog easily (from A to Z)
How to Start a WordPress Blog easily (from A to Z)How to Start a WordPress Blog easily (from A to Z)
How to Start a WordPress Blog easily (from A to Z)Peter Nguyen
 
WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014Fikri Rasyid
 
WordPress 101 less than an hour
WordPress 101 less than an hourWordPress 101 less than an hour
WordPress 101 less than an hourAngela Samuels
 
Flexible web publishing with Expression Engine
Flexible web publishing with Expression EngineFlexible web publishing with Expression Engine
Flexible web publishing with Expression EngineHarvard Web Working Group
 
Creating a wordle for cbs
Creating a wordle for cbsCreating a wordle for cbs
Creating a wordle for cbsKathy Sheridan
 
Advanced Custom Fields: a Designer's Approach
Advanced Custom Fields: a Designer's ApproachAdvanced Custom Fields: a Designer's Approach
Advanced Custom Fields: a Designer's ApproachLiam Dempsey
 
Getting the Most out of the Genesis Theme Framework
Getting the Most out of the Genesis Theme FrameworkGetting the Most out of the Genesis Theme Framework
Getting the Most out of the Genesis Theme FrameworkEast Bay WordPress Meetup
 
Building Websites with WordPress UBC Summer 2012
Building Websites with WordPress UBC Summer 2012Building Websites with WordPress UBC Summer 2012
Building Websites with WordPress UBC Summer 2012Tris Hussey
 

Tendances (20)

The Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child ThemesThe Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child Themes
 
What Is WordPress and Why Is Everyone Talking About It?
What Is WordPress and Why Is Everyone Talking About It?What Is WordPress and Why Is Everyone Talking About It?
What Is WordPress and Why Is Everyone Talking About It?
 
Birthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp ScrantonBirthing a Child Theme - WordCamp Scranton
Birthing a Child Theme - WordCamp Scranton
 
Getting into WordPress Front End Development
Getting into WordPress Front End DevelopmentGetting into WordPress Front End Development
Getting into WordPress Front End Development
 
Child Theming: An Introduction to Wordpress Theme Development with Wordpres...
Child Theming: An Introduction to  Wordpress Theme Development  with Wordpres...Child Theming: An Introduction to  Wordpress Theme Development  with Wordpres...
Child Theming: An Introduction to Wordpress Theme Development with Wordpres...
 
Intro to StudioPress child themes
Intro to StudioPress child themesIntro to StudioPress child themes
Intro to StudioPress child themes
 
Intro to WordPress Child Themes (NERDS Sept 2014)
Intro to WordPress Child Themes (NERDS Sept 2014)Intro to WordPress Child Themes (NERDS Sept 2014)
Intro to WordPress Child Themes (NERDS Sept 2014)
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child Themes
 
How to Start a WordPress Blog easily (from A to Z)
How to Start a WordPress Blog easily (from A to Z)How to Start a WordPress Blog easily (from A to Z)
How to Start a WordPress Blog easily (from A to Z)
 
The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)
 
Weingarten Beamer
Weingarten BeamerWeingarten Beamer
Weingarten Beamer
 
WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014
 
WordPress 101 less than an hour
WordPress 101 less than an hourWordPress 101 less than an hour
WordPress 101 less than an hour
 
Using Wordpress for Internet Publishing
Using Wordpress for Internet PublishingUsing Wordpress for Internet Publishing
Using Wordpress for Internet Publishing
 
Flexible web publishing with Expression Engine
Flexible web publishing with Expression EngineFlexible web publishing with Expression Engine
Flexible web publishing with Expression Engine
 
Creating a wordle for cbs
Creating a wordle for cbsCreating a wordle for cbs
Creating a wordle for cbs
 
Powerpointpres
PowerpointpresPowerpointpres
Powerpointpres
 
Advanced Custom Fields: a Designer's Approach
Advanced Custom Fields: a Designer's ApproachAdvanced Custom Fields: a Designer's Approach
Advanced Custom Fields: a Designer's Approach
 
Getting the Most out of the Genesis Theme Framework
Getting the Most out of the Genesis Theme FrameworkGetting the Most out of the Genesis Theme Framework
Getting the Most out of the Genesis Theme Framework
 
Building Websites with WordPress UBC Summer 2012
Building Websites with WordPress UBC Summer 2012Building Websites with WordPress UBC Summer 2012
Building Websites with WordPress UBC Summer 2012
 

Similaire à WordPress Child 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 2013Evan Mullins
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesrfair404
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themesDaisyOlsen
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themesvegasgeek
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themesChris Olbekson
 
Introduction to WordPress Child Themes
Introduction to WordPress Child ThemesIntroduction to WordPress Child Themes
Introduction to WordPress Child Themesoneilldec
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesopenchamp
 
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015topher1kenobe
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themeshenri_makembe
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPressJeff Cohan
 
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
 
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
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themesTom Jenkins
 
WP Joburg Meetup 10: Genesis Framework by Trish Cornelius
WP Joburg Meetup 10: Genesis Framework by Trish CorneliusWP Joburg Meetup 10: Genesis Framework by Trish Cornelius
WP Joburg Meetup 10: Genesis Framework by Trish CorneliusWPJoburg
 
Intro to child themes
Intro to child themesIntro to child themes
Intro to child themesvegasgeek
 
What are child themes, and why use them
What are child themes, and why use themWhat are child themes, and why use them
What are child themes, and why use themUtsav Singh Rathour
 
Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Damien Carbery
 
The Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano EditionThe Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano EditionTorsten Landsiedel
 

Similaire à WordPress Child Themes (20)

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
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Child Theme
Child ThemeChild Theme
Child Theme
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themes
 
Introduction to WordPress Child Themes
Introduction to WordPress Child ThemesIntroduction to WordPress Child Themes
Introduction to WordPress Child Themes
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
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
 
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
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themes
 
WP Joburg Meetup 10: Genesis Framework by Trish Cornelius
WP Joburg Meetup 10: Genesis Framework by Trish CorneliusWP Joburg Meetup 10: Genesis Framework by Trish Cornelius
WP Joburg Meetup 10: Genesis Framework by Trish Cornelius
 
WPAZ Child Themes
WPAZ Child ThemesWPAZ Child Themes
WPAZ Child Themes
 
Intro to child themes
Intro to child themesIntro to child themes
Intro to child themes
 
What are child themes, and why use them
What are child themes, and why use themWhat are child themes, and why use them
What are child themes, and why use them
 
Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017
 
The Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano EditionThe Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano Edition
 

Dernier

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

WordPress Child Themes

  • 1. WordPress Child Themes by Alison Foxall, Designer & Partner @ Gobble Logic @alisonmf www.alisonfoxall.com @gobblelogic www.gobblelogic.com
  • 2. By Definition Child Theme A theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme. Translation: A theme for a theme
  • 3. Key Benefits Protect your changes (from upgrading a parent theme) i.e. You change the Twenty Eleven Theme around to better suit your needs, but Oh! Look! WordPress wants to upgrade some things. You get on a click-happy upgrade frenzy, and accidentally upgrade your Twenty Eleven Theme to the newest version, and overwriting everything you have worked for. You can avoid this heart-sinking catastrophe by creating a Child Theme for Twenty Eleven instead. Additional Functionality (cooler features) i.e. Someone (or you) could make a theme that just does more for you in terms of functionality, with the same look and feel of Twenty Eleven. Creating this Child Theme would enable you to keep these features without them getting overwritten.
  • 4. Remember! Child Themes Should... Realistically a child theme should be nothing more than a stylesheet and some additional functions. Nothing crazy. Too much, and you should be making a parent theme, otherwise problems can occur with upgradability.
  • 5. Creating a Child Theme Directory Hierarchy Child Themes reside in the same folder as the ‘themes’ folder. It does NOT reside in the parent theme folder. e.g. themes twentyeleven twentyeleven-mychild twentyten Style.css This is needed in the folder to actually create a theme
  • 6. Style.css Carry on as normal except... As with any WordPress theme, the information header must be at the top of the file, the only difference being that in a child theme the Template: line is required, so that WordPress knows which theme is the parent of the child theme. It should be the directory name of the folder, case sensitive. /* Theme Name: Twenty Eleven Child Theme URI: http://example.com/ Description: Child theme for the Twenty Eleven theme Author: Your name here Author URI: http://example.com/about/ Template: twentyeleven Version: 0.1.0 */
  • 7. Noted Overrides Your new style.css will OVERRIDE the parent style.css. With this in mind, @import your parent stylesheet and then start making your changes. You do not need to use the !important declaration. Other Paths Lesson Learned: Don’t use bloginfo(stylesheet_directory) in your parent themes when linking to files. Instead, use something like this to obtain a uri path for javascript libraries, css, and other paths in your template files: echo get_template_directory_uri()