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 ...
Do Make Sure Child Themes
Work Properly
Make sure your theme works with child themes.
This includes ‘Template Builders’, T...
Don’t just add scripts & stylesheets to header.php
or footer.php
Use wp_register_style() & wp_enqueue_style()*
Use wp_regi...
Don’t Remove Core Functionality
Never ever, ever remove (or override) core
functionality.
Just don’t ok!
Wednesday, 11 Sep...
Don’t Read or Write to the
Database Directly
If you need to query the database, WordPress has a
function for that!
Wednesd...
Don’t Change Functionality of
index.php
This is the file that produces your blog archive.
If you need a custom homepage, us...
Don’t have Theme Options
Overload
You don’t need one million different theme options
No really, you don’t! http://catalyst...
Do follow WordPress Coding
Standards
PHP Coding Standards
http://make.wordpress.org/core/handbook/coding-standards/php/
HT...
Questions?
You can find me here...
maddisondesigns.com
easywpguide.com
@maddisondesigns
Wednesday, 11 September 13
Upcoming SlideShare
Loading in …5
×

Do's & Don'ts for WordPress Theme Development

4,014 views

Published on

Everyone loves a well constructed WordPress theme. Learn about the things you should and shouldn't do when coding up a WordPress theme. Not only will it make your theme more awesome, but your end users will love you for doing things the right way!

Published in: Technology, Business
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total views
4,014
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
15
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Do's & Don'ts for WordPress Theme Development

  1. 1. Do's & Don’ts for WordPress Theme Development #WPMelb Anthony Hortin @maddisondesigns Wednesday, 11 September 13
  2. 2. Just don’t Ok! That’s what stylesheets are for! Don’t Use Inline Styles Wednesday, 11 September 13
  3. 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. 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. 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. 6. Don’t Remove Core Functionality Never ever, ever remove (or override) core functionality. Just don’t ok! Wednesday, 11 September 13
  7. 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. 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. 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. 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. 11. Questions? You can find me here... maddisondesigns.com easywpguide.com @maddisondesigns Wednesday, 11 September 13

×