things i wish i had known before developing a wordpress theme

63
Things I Wish I Had Known Before Developing a WordPress Theme Konstantin Kovshenin Automattic

Upload: konstantin-kovshenin

Post on 28-Jan-2015

107 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Things I Wish I Had Known Before Developing a WordPress Theme

Things I Wish I Had Known Before Developing a WordPress ThemeKonstantin KovsheninAutomattic

Page 2: Things I Wish I Had Known Before Developing a WordPress Theme
Page 3: Things I Wish I Had Known Before Developing a WordPress Theme

K

Page 4: Things I Wish I Had Known Before Developing a WordPress Theme

Publish

Page 5: Things I Wish I Had Known Before Developing a WordPress Theme

Expound

Page 6: Things I Wish I Had Known Before Developing a WordPress Theme
Page 7: Things I Wish I Had Known Before Developing a WordPress Theme

Get Organized

Page 8: Things I Wish I Had Known Before Developing a WordPress Theme

WordPress Coding Standards

Page 9: Things I Wish I Had Known Before Developing a WordPress Theme

wp_enqueue_script()wp_enqueue_style()

Page 10: Things I Wish I Had Known Before Developing a WordPress Theme

Don’t Bundle Scripts Which are Available in

WordPress

Page 11: Things I Wish I Had Known Before Developing a WordPress Theme

Use Subdirectories

Page 12: Things I Wish I Had Known Before Developing a WordPress Theme

get_template_part()

Page 13: Things I Wish I Had Known Before Developing a WordPress Theme

get_template_part( 'content', get_post_format() );

Page 14: Things I Wish I Had Known Before Developing a WordPress Theme

query_posts()

Page 15: Things I Wish I Had Known Before Developing a WordPress Theme

Stop query_posts

Page 16: Things I Wish I Had Known Before Developing a WordPress Theme

query_posts() is bad and you should never use it

“”

— Andrew Nacin, WordPress Lead Developer

Page 17: Things I Wish I Had Known Before Developing a WordPress Theme

pre_get_posts

Page 18: Things I Wish I Had Known Before Developing a WordPress Theme

new WP_Query()get_posts()

Page 19: Things I Wish I Had Known Before Developing a WordPress Theme

Theme Options

Page 20: Things I Wish I Had Known Before Developing a WordPress Theme

Weaver

Page 21: Things I Wish I Had Known Before Developing a WordPress Theme

Decisions, not Options

Page 22: Things I Wish I Had Known Before Developing a WordPress Theme

Feature Bloat and Plugin Territory

Page 23: Things I Wish I Had Known Before Developing a WordPress Theme
Page 24: Things I Wish I Had Known Before Developing a WordPress Theme
Page 25: Things I Wish I Had Known Before Developing a WordPress Theme
Page 26: Things I Wish I Had Known Before Developing a WordPress Theme
Page 27: Things I Wish I Had Known Before Developing a WordPress Theme
Page 28: Things I Wish I Had Known Before Developing a WordPress Theme

Portfolio Post Type

Page 29: Things I Wish I Had Known Before Developing a WordPress Theme

Implement CoreFeatures

Page 30: Things I Wish I Had Known Before Developing a WordPress Theme

add_editor_style()

Page 31: Things I Wish I Had Known Before Developing a WordPress Theme

Localize Your Theme

Page 32: Things I Wish I Had Known Before Developing a WordPress Theme

Default Widget Styles

Page 33: Things I Wish I Had Known Before Developing a WordPress Theme

Monster Widget

Page 34: Things I Wish I Had Known Before Developing a WordPress Theme

if ( function_exists( 'register_sidebar' ) ) {

Page 35: Things I Wish I Had Known Before Developing a WordPress Theme

dynamic_sidebar()is_active_sidebar()

Page 36: Things I Wish I Had Known Before Developing a WordPress Theme

Be a Good Parent (Theme)

Page 37: Things I Wish I Had Known Before Developing a WordPress Theme

Simple Structure

Page 38: Things I Wish I Had Known Before Developing a WordPress Theme

!important

Page 39: Things I Wish I Had Known Before Developing a WordPress Theme

BackwardsCompatibility

Page 40: Things I Wish I Had Known Before Developing a WordPress Theme

Pluggable Functions

Page 41: Things I Wish I Had Known Before Developing a WordPress Theme

if ( ! function_exists( 'foo' ) ):function foo() { ...}endif;

Page 42: Things I Wish I Had Known Before Developing a WordPress Theme

Actions and Filters

Page 43: Things I Wish I Had Known Before Developing a WordPress Theme

Listen

Page 44: Things I Wish I Had Known Before Developing a WordPress Theme

Be a Good Child(Theme)

Page 45: Things I Wish I Had Known Before Developing a WordPress Theme

Speed is Everything

Page 46: Things I Wish I Had Known Before Developing a WordPress Theme

Optimize Your Images

Page 47: Things I Wish I Had Known Before Developing a WordPress Theme

smushitoptipng

pngcrushjpegtran

Page 48: Things I Wish I Had Known Before Developing a WordPress Theme

Cache ComplexQueries

Page 49: Things I Wish I Had Known Before Developing a WordPress Theme

function _s_categorized_blog() { $c = get_transient( 'cool_cats' ); if ( false === $c ) { $c = count( get_categories( … ) ); set_transient( 'cool_cats', $c ); } return $c > 1;}

Page 50: Things I Wish I Had Known Before Developing a WordPress Theme

10x Faster!

Page 51: Things I Wish I Had Known Before Developing a WordPress Theme

get_option( 'sticky_posts' )

Page 52: Things I Wish I Had Known Before Developing a WordPress Theme

Benchmark

Page 53: Things I Wish I Had Known Before Developing a WordPress Theme

Security

Page 54: Things I Wish I Had Known Before Developing a WordPress Theme

wp_kses()esc_html()esc_attr()esc_url()

...

Page 55: Things I Wish I Had Known Before Developing a WordPress Theme

Don’t Use TimThumb

Page 56: Things I Wish I Had Known Before Developing a WordPress Theme

set_post_thumbnail_size()add_image_size()

Page 57: Things I Wish I Had Known Before Developing a WordPress Theme

WordPress.org Themes Directory

Page 58: Things I Wish I Had Known Before Developing a WordPress Theme

make.wordpress.org/themes

Page 59: Things I Wish I Had Known Before Developing a WordPress Theme

What Makes a Good WordPress Theme?

Page 60: Things I Wish I Had Known Before Developing a WordPress Theme

Great DesignEase of UseSimple StructureFlexibilitySpeedReliabilitySecurity

Page 61: Things I Wish I Had Known Before Developing a WordPress Theme

Konstantin Kovsheninkovshenin.com/wcsf2013

Page 62: Things I Wish I Had Known Before Developing a WordPress Theme
Page 63: Things I Wish I Had Known Before Developing a WordPress Theme