Contenu connexe Similaire à Cain & Obenland — Episode 4 Similaire à Cain & Obenland — Episode 4 (20) Plus de Konstantin Obenland Plus de Konstantin Obenland (14) Cain & Obenland — Episode 43. Do You _stand Themes?
The real C’n’O in The OC
Special Guest: Mike Schroder
Hooking Up with WordPress
8. Why Underscores
• Just the right amount.
• Experience from five default themes.
• Experience from creating themes for millions of users on
WordPress.com.
• Does everything the WordPress way.
9. Why Underscores
• Semi-standard for WordPress.org Theme Repository.
• Best feature is its lack of features! No tearing down
necessary.
• Readable code with good documentation.
• Very active community.
10. 2010 2011 2012 2013 2014
Pedigree
Twenty
Eleven
Twenty
Ten
Twenty
Twelve
Twenty
Thirteen
Toolbox
Twenty
Fourteen
Further
Twenty
Fifteen
16. In no every way affiliated with
or and sponsored by…
22. In no every way affiliated with
or and sponsored by…
26. WordPress Actions and Filters
Allow you to modify or add functionality
by calling functions at specific times.
27. WordPress Actions and Filters
Filters call functions that take some kind of input,
modify it, and return it.
28. function my_plugin_custom_content( $content ) {
$search = 'Michael Cain';
$replace = 'Michael "The Great" Cain';
$content = preg_replace( $search, $replace, $content );
!
return $content;
}
add_filter( 'the_content', 'my_plugin_custom_content' );
30. function my_theme_google_font() {
wp_enqueue_style(
'my-theme-montserrat',
'//fonts.googleapis.com/css?family=Montserrat',
array(),
null
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_google_font' );
31. Keep on Hookin’
Filter Functions
• add_action()
• has_action()
• do_action()
• do_action_ref_array()
• doing_action()
• did_action()
• remove_action()
• remove_all_actions()
Action Functions
• add_filter()
• has_filter()
• apply_filters()
• doing_filter()
• current_filter()
• remove_filter()
• remove_all_filters()
32. Keep on Hookin’
Filter Functions
• add_action()
• has_action()
• do_action()
• do_action_ref_array()
• doing_action()
• did_action()
• remove_action()
• remove_all_actions()
Action Functions
• add_filter()
• has_filter()
• apply_filters()
• doing_filter()
• current_filter()
• remove_filter()
• remove_all_filters()