SlideShare a Scribd company logo
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Do you really

need a Child Theme?
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Bego Mario Garde
Happy WordPress user since 7 years

Moderator in German support forums

General Translation Editor
… and this is my first WordCamp session!
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Some general assumptions
Don't hack WordPress Core. Never.
Reasons: Updates overwrite your changes 

Your site gets unmaintainable

Difficult to provide support
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Some general assumptions
Don't hack WordPress Themes.
Reasons: Updates overwrite your changes 

Your theme gets unmaintainable

Difficult to provide support
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
The obvious solution
Create a Child Theme!
Reason: Updates don't overwrite your changes.
Changes are easy to spot. 

WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
The obvious solution
Create a Child Theme!
Reason: Updates don't overwrite your changes.
Changes are easy to spot. 

Well, sort of.
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.php .js .css
Child Theme
What about security issues?
.php .js .css
Parent Theme
.php
We copy templates of a Parent
Theme into the Child Theme and
tweak them as needed.
But what, if the Parent Theme had
a bug or even security issues?
The Child Theme Dilemma, T. Landsiedel 

http://bit.ly/1SWpJFZ
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.php .js .css
Child Theme
What about security issues?
.php
.js .css
Parent Theme
.php
We copy templates of a Parent
Theme into the Child Theme and
tweak them as needed.
But what, if the Parent Theme had
a bug or even security issues?
The Child Theme Dilemma, T. Landsiedel 

http://bit.ly/1SWpJFZ
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.php .js .css
Child Theme
What about security issues?
.php
.js .css
Parent Theme
.php
While the Parent Theme gets
fixed by the theme developer,
… the Child Theme keeps the bug.

(worst case: you don't even notice)
The Child Theme Dilemma, T. Landsiedel 

http://bit.ly/1SWpJFZ
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.php .js .css
Child Theme
What about security issues?
.php
.js .css
Parent Theme
.php.php
While the Parent Theme gets
fixed by the theme developer,
… the Child Theme keeps the bug.

(worst case: you don't even notice)
The Child Theme Dilemma, T. Landsiedel 

http://bit.ly/1SWpJFZ
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.php .js .css
Child Theme
Other issues?
.php
.js .css
Parent Theme
.php.php
Theme developers may change
function and class names.
Worst Case: Your website shows
an error message. Only.
(That's when your client calls!)
The Child Theme Dilemma, T. Landsiedel 

http://bit.ly/1SWpJFZ
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Solution: Plugin Child Theme Check
Plugin Child Theme Check

https://wordpress.org/plugins/child-theme-check/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Parent Theme
Child Theme
Plugin Child Theme Check

https://wordpress.org/plugins/child-theme-check/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Parent Theme
Child Theme
Plugin Child Theme Check

https://wordpress.org/plugins/child-theme-check/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Plugin Child Theme Check
Great idea, great tool, but …
Theme Review Team not convinced 

about version numbers in templates
Changes still hard to maintain
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
More sites, more Child Themes
Things get a little messy, 

if you create a new Child Theme

for every new client.
How do you manage all of them 

after two months? After two years?
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
So… 
Do you really

need a Child Theme?
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 1

Check your Theme Options. Really.
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Photo "Strawberries" by @veeterzy, CC-0

https://unsplash.com/photos/OJJIaFZOeX4
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin https://wordpress.org/themes/twentysixteen
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Theme options generally provide
you with more options, than you
realize. Play with them. Use them.
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 2

Plugins for Custom CSS
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Right Click ➞
Inspect Element
Try any value
Copy best result
Developer Tools
Chrome Developer Tools

https://developer.chrome.com/devtools
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
.site-header {
padding: 0;

}
.header-image {
margin: 0 0 5em 0;
img {
width: 100%;

height: auto;
}
}
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Support for SASS
Add-on or 

Replacement
Revisions
Disables on 

syntax errors
Jetpack
Plugin Jetpack

https://wordpress.org/plugins/jetpack/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
One Trick Pony
Easy and reliable
No revisions
No support for
SASS
Simple 

Custom CSS
Plugin Simple Custom CSS

https://wordpress.org/plugins/simple-custom-css/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Need to style
individual pages?
No Problem!
WordPress adds
the right body
Class
body Class
WP Codex: Function Reference/body class

http://bit.ly/1seFLBw
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Need to style
individual pages?
No Problem!
WordPress adds
the right body
Class
body Class
WP Codex: Function Reference/body class

http://bit.ly/1seFLBw
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 3

Add your own functions
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Additional editor to
add any function
for front or back
end
Functions can be
exported
Error handling
Code Snippets
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Replace pluggable
functions
Code Snippets
if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Replace pluggable
functions
Code Snippets
if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Error handling
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Error handling
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Plugin Code Snippets

https://wordpress.org/plugins/code-snippets/
Hooks 

to the rescue
Need to add a
custom field?
You don't need
custom templates.
Bego Mario Garde

@pixolin
add_filter( 'the_content', 'append_cf_location' );
function append_cf_location( $content ) {
$location = get_field( 'location' );
$out = $content . 

	 	 '<div class="location">Location: <strong>' . 

	 	 $location . '</strong></div>' ;
return $out;
}
WordCamp Antwerp 2016
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 4

Create Shortcodes for your own PHP
Bego Mario Garde

@pixolin
add_shortcode( 'portfolio', 'get_portfolio' );


function get_portfolio() {
$portfolios = new WP_Query( 'post_type=portfolio' );
if ( $portfolios->have_posts() ) {
	 while ( $portfolios->have_posts() ) {
	 	 $portfolios->the_post();
	 	 $out .= get_the_title();
	 }
}
return $out;
wp_reset_postdata();
}
WordCamp Antwerp 2016
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 5

Bring your own JavaScript
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Loads
frameworks
Error handling
Revisions
Custom
JavaScript
Editor
Plugin Custom JavaScript Editor

https://wordpress.org/plugins/custom-javascript-editor/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Loads
frameworks
Error handling
Revisions
Custom
JavaScript
Editor
Plugin Custom JavaScript Editor

https://wordpress.org/plugins/custom-javascript-editor/
Bego Mario Garde

@pixolin
jQuery(document).ready(function($){

	 $('#smoothup').on('click', function(){

	 	 $('html, body').animate({scrollTop:0}, 'fast');

	 	 return false;

	 	 });

});
add_action('twentysixteen_credits', 'scroll_up_link');

function scroll_up_link() {

echo '<a href="#" id="smoothup" class="siteinfo" 

	 title="Back to top">Back to Top /&nbsp;</a>';

}
WordCamp Antwerp 2016
in plugin Code Snippets
in plugin Custom JS Editor
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Step 6

Performance matters

Concatenate JavaScript and CSS
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Autoptimize
Aggregates and
minimizes JS,
CSS and HTML
Plugin Autoptimize

https://wordpress.org/plugins/autoptimize/
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Autoptimize
Aggregates CSS and JavaScript
12 CSS files ➞ 1 CSS file

14 JavaScript files ➞ 1 JavaScript file
WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
My personal Conclusion

WordCamp Antwerp 2016
Bego Mario Garde

@pixolin
Is it wrong to use Child Themes?
Is it evil to use Child Themes?
No.
But you may have better alternatives.
Dank u wel · Merci

More Related Content

PDF
Slideshare video production_guide-part2-editing
Picture Book Films - Video Production London / Brighton
 
PPTX
WordCamp Philippines 2012 WordPress and SEO Presentation
Kim Tyrone Agapito
 
KEY
The Cost of Video
Phil Thomas Di Giulio
 
DOCX
Question six
y11millara
 
KEY
Internet Broadcasting
Edward Carr
 
PDF
Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet
 
PDF
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
JAXLondon2014
 
PDF
WooCommerce Customization Masterclass (WordCamp Dublin 2017)
Rodolfo Melogli
 
Slideshare video production_guide-part2-editing
Picture Book Films - Video Production London / Brighton
 
WordCamp Philippines 2012 WordPress and SEO Presentation
Kim Tyrone Agapito
 
The Cost of Video
Phil Thomas Di Giulio
 
Question six
y11millara
 
Internet Broadcasting
Edward Carr
 
Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
JAXLondon2014
 
WooCommerce Customization Masterclass (WordCamp Dublin 2017)
Rodolfo Melogli
 

Viewers also liked (15)

PDF
James veach ppp
James Veach
 
PPT
Careers Chamblee 2011
achamblee
 
DOCX
Resume 2016-5
Siddhartha Kambampati
 
PPT
R. federer vs s. querrey wimbledon gentlemen's 2015
allenallin
 
PDF
mi16-wpseo
Vincenzo Spanò
 
PDF
The WordPress developer's toolkit
Ivelina Dimova
 
PDF
Service Design Introduction for Rainmakers
Lior Smith
 
PPTX
Startup Meets Corporate – Intrapreneurial Culture Through Startup Collaboration
Corporate Startup Summit
 
PDF
Pascal A. Miserez - Company Building für Transformationelle Innovation
Corporate Startup Summit
 
PDF
Session 14 - Working with table view and search bar
Vu Tran Lam
 
ODP
Quality (Q), Cost (C), Delivery (D)---Q-C-D
Rahul Laxman Iyer MSE Mech Eng, EIT, LSSBB/TPS/Kaizen
 
PPTX
12 Trends Influencing the Future of How We Work
Paul Taylor
 
PDF
Agile Software Engineering and Design Thinking: Efficiency and Innovation in ...
Tobias Schimmer
 
PDF
Session 9-10 - UI/UX design for iOS 7 application
Vu Tran Lam
 
James veach ppp
James Veach
 
Careers Chamblee 2011
achamblee
 
Resume 2016-5
Siddhartha Kambampati
 
R. federer vs s. querrey wimbledon gentlemen's 2015
allenallin
 
mi16-wpseo
Vincenzo Spanò
 
The WordPress developer's toolkit
Ivelina Dimova
 
Service Design Introduction for Rainmakers
Lior Smith
 
Startup Meets Corporate – Intrapreneurial Culture Through Startup Collaboration
Corporate Startup Summit
 
Pascal A. Miserez - Company Building für Transformationelle Innovation
Corporate Startup Summit
 
Session 14 - Working with table view and search bar
Vu Tran Lam
 
Quality (Q), Cost (C), Delivery (D)---Q-C-D
Rahul Laxman Iyer MSE Mech Eng, EIT, LSSBB/TPS/Kaizen
 
12 Trends Influencing the Future of How We Work
Paul Taylor
 
Agile Software Engineering and Design Thinking: Efficiency and Innovation in ...
Tobias Schimmer
 
Session 9-10 - UI/UX design for iOS 7 application
Vu Tran Lam
 
Ad

Similar to Do you really need a Child Theme? (20)

ODP
WordCamp TOR: Beyond The Guidelines - Theme Development Best Practices (Vol 1)
Chip Bennett
 
PDF
Wordpress development 101
Commit Software Sh.p.k.
 
PDF
WordPress Theme Selection Field Guide
Gloria Antonelli
 
PPTX
The Way to Theme Enlightenment 2017
Amanda Giles
 
PDF
Seven deadly theming sins
George Stephanis
 
PPTX
The Way to Theme Enlightenment
Amanda Giles
 
PDF
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Jer Clarke
 
KEY
Let's Build a Custom Theme
Andy Stratton
 
KEY
Developing client themes for theme review for WordCamp Edmonton
Curtis McHale
 
PDF
Newbies guide to customizing word press themes 25
New Tricks
 
PPTX
advance theme development
1amitgupta
 
PDF
Alice Phieu - WordPress For Beginners
Alice Phieu
 
PDF
Wordpress beyond blogging
Julien Minguely
 
PDF
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
LinnAlexandra
 
PDF
Building plugins like a pro
Marko Heijnen
 
PPTX
Writing your own WordPress themes and plugins
Stephanie Wells
 
KEY
Beginners' Guide to WordPress
Shannon Smith
 
KEY
A Beginner's Guide to WordPress - WordCamp Montreal 2012
Kathryn Presner
 
KEY
WordPress - fixing sites with problems
Victoria Pickering
 
PPTX
Word Press As A Cms
Justin Sisley
 
WordCamp TOR: Beyond The Guidelines - Theme Development Best Practices (Vol 1)
Chip Bennett
 
Wordpress development 101
Commit Software Sh.p.k.
 
WordPress Theme Selection Field Guide
Gloria Antonelli
 
The Way to Theme Enlightenment 2017
Amanda Giles
 
Seven deadly theming sins
George Stephanis
 
The Way to Theme Enlightenment
Amanda Giles
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Jer Clarke
 
Let's Build a Custom Theme
Andy Stratton
 
Developing client themes for theme review for WordCamp Edmonton
Curtis McHale
 
Newbies guide to customizing word press themes 25
New Tricks
 
advance theme development
1amitgupta
 
Alice Phieu - WordPress For Beginners
Alice Phieu
 
Wordpress beyond blogging
Julien Minguely
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
LinnAlexandra
 
Building plugins like a pro
Marko Heijnen
 
Writing your own WordPress themes and plugins
Stephanie Wells
 
Beginners' Guide to WordPress
Shannon Smith
 
A Beginner's Guide to WordPress - WordCamp Montreal 2012
Kathryn Presner
 
WordPress - fixing sites with problems
Victoria Pickering
 
Word Press As A Cms
Justin Sisley
 
Ad

More from pixolin (6)

PDF
WordPress auf Deutsch
pixolin
 
PDF
WordPress auf Deutsch – Der aktuelle Stand.
pixolin
 
PDF
Global WordPress Translation Day – WordPress Meetup FRA
pixolin
 
PDF
WooCommerce
pixolin
 
PDF
Childthemes 2
pixolin
 
PDF
Childthemes mit git – WordPress MeetUp CGN
pixolin
 
WordPress auf Deutsch
pixolin
 
WordPress auf Deutsch – Der aktuelle Stand.
pixolin
 
Global WordPress Translation Day – WordPress Meetup FRA
pixolin
 
WooCommerce
pixolin
 
Childthemes 2
pixolin
 
Childthemes mit git – WordPress MeetUp CGN
pixolin
 

Recently uploaded (20)

PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PPTX
How tech helps people in the modern era.
upadhyayaryan154
 
PPTX
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
PPTX
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PPTX
Parallel & Concurrent ...
yashpavasiya892
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
Slides Powerpoint: Eco Economic Epochs.pptx
Steven McGee
 
PPTX
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PDF
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
PPTX
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
PPTX
AI ad its imp i military life read it ag
ShwetaBharti31
 
PPT
1965 INDO PAK WAR which Pak will never forget.ppt
sanjaychief112
 
PPTX
Crypto Recovery California Services.pptx
lionsgate network
 
PDF
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
PPTX
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
PPTX
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
PPTX
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
PDF
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
Different Generation Of Computers .pptx
divcoder9507
 
How tech helps people in the modern era.
upadhyayaryan154
 
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
Parallel & Concurrent ...
yashpavasiya892
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
Slides Powerpoint: Eco Economic Epochs.pptx
Steven McGee
 
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
AI ad its imp i military life read it ag
ShwetaBharti31
 
1965 INDO PAK WAR which Pak will never forget.ppt
sanjaychief112
 
Crypto Recovery California Services.pptx
lionsgate network
 
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 

Do you really need a Child Theme?

  • 1. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Do you really
 need a Child Theme?
  • 2. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Bego Mario Garde Happy WordPress user since 7 years
 Moderator in German support forums
 General Translation Editor … and this is my first WordCamp session!
  • 3. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Some general assumptions Don't hack WordPress Core. Never. Reasons: Updates overwrite your changes 
 Your site gets unmaintainable
 Difficult to provide support
  • 4. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Some general assumptions Don't hack WordPress Themes. Reasons: Updates overwrite your changes 
 Your theme gets unmaintainable
 Difficult to provide support
  • 5. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin The obvious solution Create a Child Theme! Reason: Updates don't overwrite your changes. Changes are easy to spot. 

  • 6. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin The obvious solution Create a Child Theme! Reason: Updates don't overwrite your changes. Changes are easy to spot. 
 Well, sort of.
  • 7. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .php .js .css Child Theme What about security issues? .php .js .css Parent Theme .php We copy templates of a Parent Theme into the Child Theme and tweak them as needed. But what, if the Parent Theme had a bug or even security issues? The Child Theme Dilemma, T. Landsiedel 
 http://bit.ly/1SWpJFZ
  • 8. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .php .js .css Child Theme What about security issues? .php .js .css Parent Theme .php We copy templates of a Parent Theme into the Child Theme and tweak them as needed. But what, if the Parent Theme had a bug or even security issues? The Child Theme Dilemma, T. Landsiedel 
 http://bit.ly/1SWpJFZ
  • 9. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .php .js .css Child Theme What about security issues? .php .js .css Parent Theme .php While the Parent Theme gets fixed by the theme developer, … the Child Theme keeps the bug.
 (worst case: you don't even notice) The Child Theme Dilemma, T. Landsiedel 
 http://bit.ly/1SWpJFZ
  • 10. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .php .js .css Child Theme What about security issues? .php .js .css Parent Theme .php.php While the Parent Theme gets fixed by the theme developer, … the Child Theme keeps the bug.
 (worst case: you don't even notice) The Child Theme Dilemma, T. Landsiedel 
 http://bit.ly/1SWpJFZ
  • 11. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .php .js .css Child Theme Other issues? .php .js .css Parent Theme .php.php Theme developers may change function and class names. Worst Case: Your website shows an error message. Only. (That's when your client calls!) The Child Theme Dilemma, T. Landsiedel 
 http://bit.ly/1SWpJFZ
  • 12. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Solution: Plugin Child Theme Check Plugin Child Theme Check
 https://wordpress.org/plugins/child-theme-check/
  • 13. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Parent Theme Child Theme Plugin Child Theme Check
 https://wordpress.org/plugins/child-theme-check/
  • 14. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Parent Theme Child Theme Plugin Child Theme Check
 https://wordpress.org/plugins/child-theme-check/
  • 15. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Plugin Child Theme Check Great idea, great tool, but … Theme Review Team not convinced 
 about version numbers in templates Changes still hard to maintain
  • 16. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin More sites, more Child Themes Things get a little messy, 
 if you create a new Child Theme
 for every new client. How do you manage all of them 
 after two months? After two years?
  • 17. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin So…  Do you really
 need a Child Theme?
  • 18. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 1
 Check your Theme Options. Really.
  • 19. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Photo "Strawberries" by @veeterzy, CC-0
 https://unsplash.com/photos/OJJIaFZOeX4
  • 20. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin https://wordpress.org/themes/twentysixteen
  • 21. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin
  • 22. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Theme options generally provide you with more options, than you realize. Play with them. Use them.
  • 23. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 2
 Plugins for Custom CSS
  • 24. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin
  • 25. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin
  • 26. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Right Click ➞ Inspect Element Try any value Copy best result Developer Tools Chrome Developer Tools
 https://developer.chrome.com/devtools
  • 27. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin .site-header { padding: 0;
 } .header-image { margin: 0 0 5em 0; img { width: 100%;
 height: auto; } }
  • 28. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Support for SASS Add-on or 
 Replacement Revisions Disables on 
 syntax errors Jetpack Plugin Jetpack
 https://wordpress.org/plugins/jetpack/
  • 29. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin One Trick Pony Easy and reliable No revisions No support for SASS Simple 
 Custom CSS Plugin Simple Custom CSS
 https://wordpress.org/plugins/simple-custom-css/
  • 30. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Need to style individual pages? No Problem! WordPress adds the right body Class body Class WP Codex: Function Reference/body class
 http://bit.ly/1seFLBw
  • 31. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Need to style individual pages? No Problem! WordPress adds the right body Class body Class WP Codex: Function Reference/body class
 http://bit.ly/1seFLBw
  • 32. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 3
 Add your own functions
  • 33. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Additional editor to add any function for front or back end Functions can be exported Error handling Code Snippets Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/
  • 34. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Replace pluggable functions Code Snippets if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/
  • 35. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Replace pluggable functions Code Snippets if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/
  • 36. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin
  • 37. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Error handling Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/
  • 38. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Error handling Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/
  • 39. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Plugin Code Snippets
 https://wordpress.org/plugins/code-snippets/ Hooks 
 to the rescue Need to add a custom field? You don't need custom templates.
  • 40. Bego Mario Garde
 @pixolin add_filter( 'the_content', 'append_cf_location' ); function append_cf_location( $content ) { $location = get_field( 'location' ); $out = $content . 
 '<div class="location">Location: <strong>' . 
 $location . '</strong></div>' ; return $out; } WordCamp Antwerp 2016
  • 41. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 4
 Create Shortcodes for your own PHP
  • 42. Bego Mario Garde
 @pixolin add_shortcode( 'portfolio', 'get_portfolio' ); 
 function get_portfolio() { $portfolios = new WP_Query( 'post_type=portfolio' ); if ( $portfolios->have_posts() ) { while ( $portfolios->have_posts() ) { $portfolios->the_post(); $out .= get_the_title(); } } return $out; wp_reset_postdata(); } WordCamp Antwerp 2016
  • 43. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 5
 Bring your own JavaScript
  • 44. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Loads frameworks Error handling Revisions Custom JavaScript Editor Plugin Custom JavaScript Editor
 https://wordpress.org/plugins/custom-javascript-editor/
  • 45. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Loads frameworks Error handling Revisions Custom JavaScript Editor Plugin Custom JavaScript Editor
 https://wordpress.org/plugins/custom-javascript-editor/
  • 46. Bego Mario Garde
 @pixolin jQuery(document).ready(function($){
 $('#smoothup').on('click', function(){
 $('html, body').animate({scrollTop:0}, 'fast');
 return false;
 });
 }); add_action('twentysixteen_credits', 'scroll_up_link');
 function scroll_up_link() {
 echo '<a href="#" id="smoothup" class="siteinfo" 
 title="Back to top">Back to Top /&nbsp;</a>';
 } WordCamp Antwerp 2016 in plugin Code Snippets in plugin Custom JS Editor
  • 47. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Step 6
 Performance matters
 Concatenate JavaScript and CSS
  • 48. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Autoptimize Aggregates and minimizes JS, CSS and HTML Plugin Autoptimize
 https://wordpress.org/plugins/autoptimize/
  • 49. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Autoptimize Aggregates CSS and JavaScript 12 CSS files ➞ 1 CSS file
 14 JavaScript files ➞ 1 JavaScript file
  • 50. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin My personal Conclusion

  • 51. WordCamp Antwerp 2016 Bego Mario Garde
 @pixolin Is it wrong to use Child Themes? Is it evil to use Child Themes? No. But you may have better alternatives. Dank u wel · Merci