SlideShare a Scribd company logo
Do's & Don’ts for WordPress
Theme Development
#WPMelb
Anthony Hortin
@maddisondesigns
Wednesday, 11 September 13
Just don’t Ok!
That’s what stylesheets are for!
Don’t Use Inline Styles
Wednesday, 11 September 13
If you really must have 25 sliders, only load the
script for the one that’s used, not all 25!
Don’t Load scripts on pages that don’t need them.
if ( is_front_page() )
wp_register_script( ... );
wp_enqueue_script( ... );
}
Don’t Load Scripts if they’re
not Required
Wednesday, 11 September 13
Do Make Sure Child Themes
Work Properly
Make sure your theme works with child themes.
This includes ‘Template Builders’, Theme Options etc.
‘Nuff said.
Wednesday, 11 September 13
Don’t just add scripts & stylesheets to header.php
or footer.php
Use wp_register_style() & wp_enqueue_style()*
Use wp_register_script() & wp_enqueue_script()*
*If your scripts have dependencies, you don’t need to enqueue
those dependencies. WordPress is smart enough to
automagically do that for you
Do Enqueue Scripts &
Stylesheets Properly
Wednesday, 11 September 13
Don’t Remove Core Functionality
Never ever, ever remove (or override) core
functionality.
Just don’t ok!
Wednesday, 11 September 13
Don’t Read or Write to the
Database Directly
If you need to query the database, WordPress has a
function for that!
Wednesday, 11 September 13
Don’t Change Functionality of
index.php
This is the file that produces your blog archive.
If you need a custom homepage, use front-page.php
Don’t break the Reading Settings functionality
Wednesday, 11 September 13
Don’t have Theme Options
Overload
You don’t need one million different theme options
No really, you don’t! http://catalysttheme.com/admin-screenshots
Wednesday, 11 September 13
Do follow WordPress Coding
Standards
PHP Coding Standards
http://make.wordpress.org/core/handbook/coding-standards/php/
HTML Coding Standards
http://make.wordpress.org/core/handbook/coding-standards/html/
CSS Coding Standards
http://make.wordpress.org/core/handbook/coding-standards/css/
Wednesday, 11 September 13
Questions?
You can find me here...
maddisondesigns.com
easywpguide.com
@maddisondesigns
Wednesday, 11 September 13

More Related Content

More from Anthony Hortin

WordPress Gutenberg
WordPress GutenbergWordPress Gutenberg
WordPress Gutenberg
Anthony Hortin
 
Developing for the WordPress Customizer
Developing for the WordPress CustomizerDeveloping for the WordPress Customizer
Developing for the WordPress Customizer
Anthony Hortin
 
Developing For The WordPress Customizer
Developing For The WordPress CustomizerDeveloping For The WordPress Customizer
Developing For The WordPress Customizer
Anthony Hortin
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom Fields
Anthony Hortin
 
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
Anthony Hortin
 
Essential plugins for your WordPress Website
Essential plugins for your WordPress WebsiteEssential plugins for your WordPress Website
Essential plugins for your WordPress Website
Anthony Hortin
 
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
Anthony Hortin
 
Building a Membership Site with WooCommerce
Building a Membership Site with WooCommerceBuilding a Membership Site with WooCommerce
Building a Membership Site with WooCommerce
Anthony Hortin
 
Getting to Grips with Firebug
Getting to Grips with FirebugGetting to Grips with Firebug
Getting to Grips with Firebug
Anthony Hortin
 
Getting to Know WordPress May 2015
Getting to Know WordPress May 2015Getting to Know WordPress May 2015
Getting to Know WordPress May 2015
Anthony Hortin
 
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
Anthony Hortin
 
WordCamp San Francisco & WooCommerce Conference Recap
WordCamp San Francisco & WooCommerce Conference RecapWordCamp San Francisco & WooCommerce Conference Recap
WordCamp San Francisco & WooCommerce Conference Recap
Anthony Hortin
 
Creating a multilingual site with WPML
Creating a multilingual site with WPMLCreating a multilingual site with WPML
Creating a multilingual site with WPML
Anthony Hortin
 
Getting to know WordPress
Getting to know WordPressGetting to know WordPress
Getting to know WordPress
Anthony Hortin
 
Getting Started with WooCommerce
Getting Started with WooCommerceGetting Started with WooCommerce
Getting Started with WooCommerce
Anthony Hortin
 
Submitting to the WordPress Theme Directory
Submitting to the WordPress Theme DirectorySubmitting to the WordPress Theme Directory
Submitting to the WordPress Theme Directory
Anthony Hortin
 
WordPress Queries - the right way
WordPress Queries - the right wayWordPress Queries - the right way
WordPress Queries - the right way
Anthony Hortin
 
Getting to grips with firebug
Getting to grips with firebugGetting to grips with firebug
Getting to grips with firebug
Anthony Hortin
 

More from Anthony Hortin (18)

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
 
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
 
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
 
Getting to know WordPress
Getting to know WordPressGetting to know WordPress
Getting to know WordPress
 
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
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Do's & Don'ts for WordPress Theme Development

  • 1. Do's & Don’ts for WordPress Theme Development #WPMelb Anthony Hortin @maddisondesigns Wednesday, 11 September 13
  • 2. Just don’t Ok! That’s what stylesheets are for! Don’t Use Inline Styles Wednesday, 11 September 13
  • 3. If you really must have 25 sliders, only load the script for the one that’s used, not all 25! Don’t Load scripts on pages that don’t need them. if ( is_front_page() ) wp_register_script( ... ); wp_enqueue_script( ... ); } Don’t Load Scripts if they’re not Required Wednesday, 11 September 13
  • 4. Do Make Sure Child Themes Work Properly Make sure your theme works with child themes. This includes ‘Template Builders’, Theme Options etc. ‘Nuff said. Wednesday, 11 September 13
  • 5. Don’t just add scripts & stylesheets to header.php or footer.php Use wp_register_style() & wp_enqueue_style()* Use wp_register_script() & wp_enqueue_script()* *If your scripts have dependencies, you don’t need to enqueue those dependencies. WordPress is smart enough to automagically do that for you Do Enqueue Scripts & Stylesheets Properly Wednesday, 11 September 13
  • 6. Don’t Remove Core Functionality Never ever, ever remove (or override) core functionality. Just don’t ok! Wednesday, 11 September 13
  • 7. Don’t Read or Write to the Database Directly If you need to query the database, WordPress has a function for that! Wednesday, 11 September 13
  • 8. Don’t Change Functionality of index.php This is the file that produces your blog archive. If you need a custom homepage, use front-page.php Don’t break the Reading Settings functionality Wednesday, 11 September 13
  • 9. Don’t have Theme Options Overload You don’t need one million different theme options No really, you don’t! http://catalysttheme.com/admin-screenshots Wednesday, 11 September 13
  • 10. Do follow WordPress Coding Standards PHP Coding Standards http://make.wordpress.org/core/handbook/coding-standards/php/ HTML Coding Standards http://make.wordpress.org/core/handbook/coding-standards/html/ CSS Coding Standards http://make.wordpress.org/core/handbook/coding-standards/css/ Wednesday, 11 September 13
  • 11. Questions? You can find me here... maddisondesigns.com easywpguide.com @maddisondesigns Wednesday, 11 September 13