Things I Wish I Had Known
Before Developing a
WordPress Theme
Konstantin Kovshenin
Automattic
K
Publish
Expound
Get Organized
WordPress Coding
Standards
wp_enqueue_script()
wp_enqueue_style()
Don’t Bundle Scripts
Which are Available in
WordPress
Use Subdirectories
get_template_part()
get_template_part( 'content',
get_post_format() );
query_posts()
Stop query_posts
query_posts() is bad and
you should never use it
“
”
­— Andrew Nacin, WordPress Lead Developer
pre_get_posts
new WP_Query()
get_posts()
Theme Options
Weaver
Decisions, not Options
Feature Bloat and
Plugin Territory
Portfolio Post Type
Implement Core
Features
add_editor_style()
Localize Your Theme
Default Widget Styles
Monster Widget
if ( function_exists(
'register_sidebar' ) ) {
dynamic_sidebar()
is_active_sidebar()
Be a Good Parent
(Theme)
Simple Structure
!important
Backwards
Compatibility
Pluggable Functions
if ( ! function_exists( 'foo' ) ):
function foo() {
...
}
endif;
Actions and Filters
Listen
Be a Good Child
(Theme)
Speed is Everything
Optimize Your Images
smushit
optipng
pngcrush
jpegtran
Cache Complex
Queries
function _s_categorized_blog() {
$c = get_transient( 'cool_cats' );
if ( false === $c ) {
$c = count( get_categories( … ) ...
10x Faster!
get_option( 'sticky_posts' )
Benchmark
Security
wp_kses()
esc_html()
esc_attr()
esc_url()
...
Don’t Use TimThumb
set_post_thumbnail_size()
add_image_size()
WordPress.org Themes
Directory
make.wordpress.org/themes
What Makes a Good
WordPress Theme?
Great Design
Ease of Use
Simple Structure
Flexibility
Speed
Reliability
Security
Konstantin Kovshenin
kovshenin.com/wcsf2013
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Things I Wish I Had Known Before Developing a WordPress Theme
Upcoming SlideShare
Loading in...5
×

Things I Wish I Had Known Before Developing a WordPress Theme

2,164

Published on

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

No Downloads
Views
Total Views
2,164
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
33
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Things I Wish I Had Known Before Developing a WordPress Theme

  1. 1. Things I Wish I Had Known Before Developing a WordPress Theme Konstantin Kovshenin Automattic
  2. 2. K
  3. 3. Publish
  4. 4. Expound
  5. 5. Get Organized
  6. 6. WordPress Coding Standards
  7. 7. wp_enqueue_script() wp_enqueue_style()
  8. 8. Don’t Bundle Scripts Which are Available in WordPress
  9. 9. Use Subdirectories
  10. 10. get_template_part()
  11. 11. get_template_part( 'content', get_post_format() );
  12. 12. query_posts()
  13. 13. Stop query_posts
  14. 14. query_posts() is bad and you should never use it “ ” ­— Andrew Nacin, WordPress Lead Developer
  15. 15. pre_get_posts
  16. 16. new WP_Query() get_posts()
  17. 17. Theme Options
  18. 18. Weaver
  19. 19. Decisions, not Options
  20. 20. Feature Bloat and Plugin Territory
  21. 21. Portfolio Post Type
  22. 22. Implement Core Features
  23. 23. add_editor_style()
  24. 24. Localize Your Theme
  25. 25. Default Widget Styles
  26. 26. Monster Widget
  27. 27. if ( function_exists( 'register_sidebar' ) ) {
  28. 28. dynamic_sidebar() is_active_sidebar()
  29. 29. Be a Good Parent (Theme)
  30. 30. Simple Structure
  31. 31. !important
  32. 32. Backwards Compatibility
  33. 33. Pluggable Functions
  34. 34. if ( ! function_exists( 'foo' ) ): function foo() { ... } endif;
  35. 35. Actions and Filters
  36. 36. Listen
  37. 37. Be a Good Child (Theme)
  38. 38. Speed is Everything
  39. 39. Optimize Your Images
  40. 40. smushit optipng pngcrush jpegtran
  41. 41. Cache Complex Queries
  42. 42. function _s_categorized_blog() { $c = get_transient( 'cool_cats' ); if ( false === $c ) { $c = count( get_categories( … ) ); set_transient( 'cool_cats', $c ); } return $c > 1; }
  43. 43. 10x Faster!
  44. 44. get_option( 'sticky_posts' )
  45. 45. Benchmark
  46. 46. Security
  47. 47. wp_kses() esc_html() esc_attr() esc_url() ...
  48. 48. Don’t Use TimThumb
  49. 49. set_post_thumbnail_size() add_image_size()
  50. 50. WordPress.org Themes Directory
  51. 51. make.wordpress.org/themes
  52. 52. What Makes a Good WordPress Theme?
  53. 53. Great Design Ease of Use Simple Structure Flexibility Speed Reliability Security
  54. 54. Konstantin Kovshenin kovshenin.com/wcsf2013
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×