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. CSS core classes to target
• body classes
• .hentry
• .menu active page
• widget classes
4. Code structure concepts
• The 3 schools of code:
• Conditional
• Includes/get_template_part($slug,$name)
• functions.php
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
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. Do the right thing
• Use functions.php
• Function exists
• Your own hooks
• Build for future expansion
(child themes, portability of code)
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. 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. 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. Widgetise the planet!
• Not just for sidebars!
• If populated?
• Location conditional switch
• Get URL switch
• Custom field switch
13. WordPress menus
• Use menus anywhere!
• Last link class
• Custom walker class
• Cache it?
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. 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