SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Anthony Hortin
@maddisondesigns
The

Why, When, How

of WordPress

Child Themes
#WPMELBUser Meetup
#wpmelb @maddisondesigns
What is a Child Theme?
#wpmelb @maddisondesigns
A child theme is a theme that
inherits the functionality and
styling of another theme (called
the parent theme). Child themes
are the recommended way of
modifying an existing theme.
“
*https://codex.wordpress.org/Child_Themes
#wpmelb @maddisondesigns
Why use a Child theme?
#wpmelb @maddisondesigns
It’s Safer
If you modify a theme’s CSS or HTML directly and it gets updated,
you’ll lose all your modifications.
#wpmelb @maddisondesigns
It’s Quicker
Using a Child Theme can speed up your development time.
#wpmelb @maddisondesigns
It’s Easier
If the Parent Theme is developed properly, using a Child Theme
can make it easier to override functionality.
#wpmelb @maddisondesigns
When should you use a

Child Theme?
#wpmelb @maddisondesigns
Almost Always
If you buy a theme from a Theme Shop or even
download a free one from WordPress.org,
you should consider setting up a Child Theme.
#wpmelb @maddisondesigns
How do you create a

Child Theme?
#wpmelb @maddisondesigns
Creating a Child Theme
A Child Theme consists of the Child Theme directory,
and two files (style.css and functions.php)
#wpmelb @maddisondesigns
Create a Child Theme Folder
Step 1: Create your Child Theme directory in wp-content/themes
#wpmelb @maddisondesigns
Creating a Child Theme Stylesheet
Step 2: Create your Child Theme's stylesheet (style.css)
#wpmelb @maddisondesigns
Creating a Child Theme Stylesheet
Your Child Theme's style.css file should include:
/*
Theme Name: Your Child Theme Name
Theme URI: http://example.com/my-awesome-child-theme
Description: A description for your Child Theme
Author: Your name
Author URI: http://example.com
Template: parent-theme-folder-name
Version: 1.0.0
*/
* The Template line corresponds to the directory name of the Parent Theme.

e.g. If you were using Twenty Sixteen as the Parent Theme, you would

enter ‘twentysixteen' here (without the quotes)
#wpmelb @maddisondesigns
Creating a Child Theme’s Functions
Step 3: Create your Child Theme's functions file (functions.php)
#wpmelb @maddisondesigns
Creating a Child Theme’s Functions
Your Child Theme's functions.php file should include:
<?php
function mytheme_scripts_styles() {
// Enqueue the parent theme stylesheet
wp_enqueue_style( 'parent-style', trailingslashit( get_template_directory_uri() ) . 'style.css' );
// Ensure the default WordPress stylesheet is enqueued after the parent stylesheet
wp_enqueue_style( 'style', get_stylesheet_uri(), array( 'parent-style' ) );
}
add_action( 'wp_enqueue_scripts', 'mytheme_scripts_styles' );
#wpmelb @maddisondesigns
Activating your Child Theme
Step 4: Login to your Dashboard, go to Appearance > Themes
and activate your Child Theme
#wpmelb @maddisondesigns
High Five!
Step 5: Pat yourself on the back & have
a cuppa because you’ve just created
your first Child Theme!
#wpmelb @maddisondesigns
Creating a Child Theme’s Screenshot
Optional Step: Create a .png image (screenshot.png) to display a
screenshot on the Themes page in the Dashboard.
The image should be 1200 x 900px.
#wpmelb @maddisondesigns
WordPress Codex

https://codex.wordpress.org
Child Themes on the WordPress Codex

https://codex.wordpress.org/Child_Themes
Official WordPress Theme Directory

https://wordpress.org/themes
Example Child Theme Code

http://maddisondesigns.com/child-theme-example
Links to Remember
I’m Anthony Hortin
You can find me here
@maddisondesigns
maddisondesigns.com
@easywpguide
easywpguide.com
Thanks!
Questions?

Contenu connexe

Tendances

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
DaisyOlsen
 
Intro to template hierarchy WCTO
Intro to template hierarchy  WCTOIntro to template hierarchy  WCTO
Intro to template hierarchy WCTO
Al Davis
 
Wordpress Profitability for Agencies, Firms, and Freelancers
Wordpress Profitability for Agencies, Firms, and FreelancersWordpress Profitability for Agencies, Firms, and Freelancers
Wordpress Profitability for Agencies, Firms, and Freelancers
Cotton Rohrscheib
 
Harness the power of wordpress
Harness the power of wordpressHarness the power of wordpress
Harness the power of wordpress
Justin Ferrell
 

Tendances (20)

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Wcto2014
Wcto2014Wcto2014
Wcto2014
 
Ten Things You Should Know About WordPress
Ten Things You Should Know About WordPressTen Things You Should Know About WordPress
Ten Things You Should Know About WordPress
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1
 
WP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and PluginsWP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and Plugins
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Installing WordPress The Right Way
Installing WordPress The Right WayInstalling WordPress The Right Way
Installing WordPress The Right Way
 
Intro to template hierarchy WCTO
Intro to template hierarchy  WCTOIntro to template hierarchy  WCTO
Intro to template hierarchy WCTO
 
WordPress Theme Workshop: Part 0
WordPress Theme Workshop: Part 0WordPress Theme Workshop: Part 0
WordPress Theme Workshop: Part 0
 
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...
 
Jump to Joomla - Barcamp Nashville 2010
Jump to Joomla - Barcamp Nashville 2010Jump to Joomla - Barcamp Nashville 2010
Jump to Joomla - Barcamp Nashville 2010
 
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
 
Using Wordpress for Internet Publishing--TechConnections version
Using Wordpress for Internet Publishing--TechConnections versionUsing Wordpress for Internet Publishing--TechConnections version
Using Wordpress for Internet Publishing--TechConnections version
 
Why Blogs Are Better
Why Blogs Are BetterWhy Blogs Are Better
Why Blogs Are Better
 
Wordpress Profitability for Agencies, Firms, and Freelancers
Wordpress Profitability for Agencies, Firms, and FreelancersWordpress Profitability for Agencies, Firms, and Freelancers
Wordpress Profitability for Agencies, Firms, and Freelancers
 
Harness the power of wordpress
Harness the power of wordpressHarness the power of wordpress
Harness the power of wordpress
 
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?
 
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
 

Similaire à The Why, When, How of WordPress Child Themes

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
DaisyOlsen
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
rfair404
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
vegasgeek
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
henri_makembe
 
Child themes
Child themesChild themes
Child themes
bobwlsn
 

Similaire à The Why, When, How of 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
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup 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
 
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
 
Introduction to WordPress Child Themes
Introduction to WordPress Child ThemesIntroduction to WordPress Child Themes
Introduction to WordPress Child Themes
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themes
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction 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 Theme
Child ThemeChild Theme
Child Theme
 
Child themes
Child themesChild themes
Child themes
 
WordPress Child Themes: The what. The why. The how.
WordPress Child Themes: The what. The why. The how.WordPress Child Themes: The what. The why. The how.
WordPress Child Themes: The what. The why. The how.
 
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
 
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
 
The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
 
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)
 

Plus de Anthony Hortin

Plus de Anthony Hortin (20)

Working with WooCommerce Custom Fields
Working with WooCommerce Custom FieldsWorking with WooCommerce Custom Fields
Working with WooCommerce Custom Fields
 
WordPress Gutenberg
WordPress GutenbergWordPress Gutenberg
WordPress Gutenberg
 
Developing for the WordPress Customizer
Developing for the WordPress CustomizerDeveloping for the WordPress Customizer
Developing for the WordPress Customizer
 
Developing For The WordPress Customizer
Developing For The WordPress CustomizerDeveloping For The WordPress Customizer
Developing For The WordPress Customizer
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom Fields
 
Essential plugins for your WordPress Website
Essential plugins for your WordPress WebsiteEssential plugins for your WordPress Website
Essential plugins for your WordPress Website
 
Building a Membership Site with WooCommerce Memberships
Building a Membership Site with WooCommerce MembershipsBuilding a Membership Site with WooCommerce Memberships
Building a Membership Site with WooCommerce Memberships
 
Building a Membership Site with WooCommerce
Building a Membership Site with WooCommerceBuilding a Membership Site with WooCommerce
Building a Membership Site with WooCommerce
 
Getting to Grips with Firebug
Getting to Grips with FirebugGetting to Grips with Firebug
Getting to Grips with Firebug
 
Getting to Know WordPress May 2015
Getting to Know WordPress May 2015Getting to Know WordPress May 2015
Getting to Know WordPress May 2015
 
25 WordPress Plugins to Complement Your Site
25 WordPress Plugins to Complement Your Site25 WordPress Plugins to Complement Your Site
25 WordPress Plugins to Complement Your Site
 
WordCamp San Francisco & WooCommerce Conference Recap
WordCamp San Francisco & WooCommerce Conference RecapWordCamp San Francisco & WooCommerce Conference Recap
WordCamp San Francisco & WooCommerce Conference Recap
 
Creating a multilingual site with WPML
Creating a multilingual site with WPMLCreating a multilingual site with WPML
Creating a multilingual site with WPML
 
WordPress Visual Editor Mastery
WordPress Visual Editor MasteryWordPress Visual Editor Mastery
WordPress Visual Editor Mastery
 
Getting to know WordPress
Getting to know WordPressGetting to know WordPress
Getting to know WordPress
 
Do's & Don'ts for WordPress Theme Development
Do's & Don'ts for WordPress Theme DevelopmentDo's & Don'ts for WordPress Theme Development
Do's & Don'ts for WordPress Theme Development
 
Getting Started with WooCommerce
Getting Started with WooCommerceGetting Started with WooCommerce
Getting Started with WooCommerce
 
Submitting to the WordPress Theme Directory
Submitting to the WordPress Theme DirectorySubmitting to the WordPress Theme Directory
Submitting to the WordPress Theme Directory
 
WordPress Queries - the right way
WordPress Queries - the right wayWordPress Queries - the right way
WordPress Queries - the right way
 
Getting to grips with firebug
Getting to grips with firebugGetting to grips with firebug
Getting to grips with firebug
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

The Why, When, How of WordPress Child Themes