Turbo chargedtheme development         Jonny Allbut   Head of digital - Tanc Design      Twitter: @Jonnyauk
CSS structure concepts• Commonality and future flexibility• Create whole layout logic before classes• Plan ahead - Use comm...
CSS core classes to target• body classes• .hentry• .menu active page• widget classes
Code structure concepts• The 3 schools of code:• Conditional• Includes/get_template_part($slug,$name)• functions.php
Parent/child theme structure• Override just what you need• Re-use everything else!• Don’t re-invent the wheel• The single(...
Parent/child theme structure            CHILD THEME               PARENT THEMEstyle.css                 style.cssfooter.ph...
Parent/child how to do it/*Theme Name:    My Super Child ThemeTheme URI:     http://jonnya.net/Description:   My child the...
Do the right thing• Use functions.php• Function exists• Your own hooks• Build for future expansion  (child themes, portabi...
Use the core• DON’T just copy and paste - understand• Use core WordPress functions in your code• Look at the core - filters...
Use the core - examples• human_time_diff($from, $to)• wpautop($content)• wp_trim_words($text, $num_words, $more)• body and...
Use the core - examplesadd_filter(login_errors, my_login_function);function my_login_function(){    return null;}add_filter(...
Widgetise the planet!• Not just for sidebars!• If populated?• Location conditional switch• Get URL switch• Custom field swi...
WordPress menus• Use menus anywhere!• Last link class• Custom walker class• Cache it?
Theme customizer• New to WP3.4 - this changes EVERYTHING!• http://ottopress.com/2012/how-to-leverage-the-theme-  customize...
Stop hacking - make themes NOW!• Design to purpose• Plan ahead and re-use• Think of the future• Get smart with CSS• Widget...
Turbo chargedtheme development         Jonny Allbut   Head of digital - Tanc Design      Twitter: @Jonnyauk
Upcoming SlideShare
Loading in …5
×

Turbo charged WordPress theme development - WordCamp Edinburgh 2012

1,288 views

Published on

My presentation from WordCamp Edinburgh on WordPress theme development.

Published in: Design, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,288
On SlideShare
0
From Embeds
0
Number of Embeds
325
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Turbo charged WordPress theme development - WordCamp Edinburgh 2012

  1. 1. Turbo chargedtheme development Jonny Allbut Head of digital - Tanc Design Twitter: @Jonnyauk
  2. 2. CSS structure concepts• Commonality and future flexibility• Create whole layout logic before classes• Plan ahead - Use common - then additional specific• Classes not IDs where possible• Common core styles to target
  3. 3. CSS core classes to target• body classes• .hentry• .menu active page• widget classes
  4. 4. Code structure concepts• The 3 schools of code:• Conditional• Includes/get_template_part($slug,$name)• functions.php
  5. 5. Parent/child theme structure• Override just what you need• Re-use everything else!• Don’t re-invent the wheel• The single(ish!) file theme
  6. 6. Parent/child theme structure CHILD THEME PARENT THEMEstyle.css style.cssfooter.php header.php page.php footer.php
  7. 7. Parent/child how to do it/*Theme Name: My Super Child ThemeTheme URI: http://jonnya.net/Description: My child themeAuthor: Jonny Allbut/Tanc DesignAuthor URI: http://tancdesign.comTemplate: twentyelevenVersion: 0.1*/
  8. 8. Do the right thing• Use functions.php• Function exists• Your own hooks• Build for future expansion (child themes, portability of code)
  9. 9. Use the core• DON’T just copy and paste - understand• Use core WordPress functions in your code• Look at the core - filters• More flexibility than you may think!
  10. 10. Use the core - examples• human_time_diff($from, $to)• wpautop($content)• wp_trim_words($text, $num_words, $more)• body and post div class filters• get_• __return • _true / _false / _zero / _empty_array / _null (3.4 only)
  11. 11. Use the core - examplesadd_filter(login_errors, my_login_function);function my_login_function(){ return null;}add_filter(login_errors, create_function($a, "return null;"));add_filter(login_errors,__return_null);
  12. 12. Widgetise the planet!• Not just for sidebars!• If populated?• Location conditional switch• Get URL switch• Custom field switch
  13. 13. WordPress menus• Use menus anywhere!• Last link class• Custom walker class• Cache it?
  14. 14. Theme customizer• New to WP3.4 - this changes EVERYTHING!• http://ottopress.com/2012/how-to-leverage-the-theme- customizer-in-your-own-themes/• http://wordpress.org/extend/plugins/css/• Demonstration
  15. 15. Stop hacking - make themes NOW!• Design to purpose• Plan ahead and re-use• Think of the future• Get smart with CSS• Widgets and menus• Use the core
  16. 16. Turbo chargedtheme development Jonny Allbut Head of digital - Tanc Design Twitter: @Jonnyauk

×