Successfully reported this slideshow.
Your SlideShare is downloading. ×

Turbo charged WordPress theme development - WordCamp Edinburgh 2012

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 16 Ad
Advertisement

More Related Content

Slideshows for you (20)

Similar to Turbo charged WordPress theme development - WordCamp Edinburgh 2012 (20)

Advertisement

More from Jonny Allbut (14)

Recently uploaded (20)

Advertisement

Turbo charged WordPress theme development - WordCamp Edinburgh 2012

  1. 1. Turbo charged theme 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 ID's 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 THEME style.css style.css footer.php header.php page.php footer.php
  7. 7. Parent/child how to do it /* Theme Name: My Super Child Theme Theme URI: http://jonnya.net/ Description: My child theme Author: Jonny Allbut/Tanc Design Author URI: http://tancdesign.com Template: twentyeleven Version: 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 - examples add_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 charged theme development Jonny Allbut Head of digital - Tanc Design Twitter: @Jonnyauk

×