SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
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( … ) );
set_transient( 'cool_cats', $c );
}
return $c > 1;
}
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

Weitere ähnliche Inhalte

Ähnlich wie Things I Wish I Had Known Before Developing a WordPress Theme

Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
K.Adam White
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
Joe Querin
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
Marakana Inc.
 

Ähnlich wie Things I Wish I Had Known Before Developing a WordPress Theme (20)

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Easy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationEasy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme Integration
 
Building themesfromscratchwithframeworks
Building themesfromscratchwithframeworksBuilding themesfromscratchwithframeworks
Building themesfromscratchwithframeworks
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2
 
To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Plugin Development - WP Meetup Antwerp
Plugin Development - WP Meetup AntwerpPlugin Development - WP Meetup Antwerp
Plugin Development - WP Meetup Antwerp
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
Breaking the limits_of_page_objects
Breaking the limits_of_page_objectsBreaking the limits_of_page_objects
Breaking the limits_of_page_objects
 

Mehr von Konstantin Kovshenin

Road to Platform @ WordPress.com VIP Workshop 2014
Road to Platform @ WordPress.com VIP Workshop 2014Road to Platform @ WordPress.com VIP Workshop 2014
Road to Platform @ WordPress.com VIP Workshop 2014
Konstantin Kovshenin
 

Mehr von Konstantin Kovshenin (16)

Scaling out with WordPress
Scaling out with WordPressScaling out with WordPress
Scaling out with WordPress
 
Memory Management in WordPress
Memory Management in WordPressMemory Management in WordPress
Memory Management in WordPress
 
Пожиратели памяти в WordPress
Пожиратели памяти в WordPressПожиратели памяти в WordPress
Пожиратели памяти в WordPress
 
7 убийц производительности WordPress
7 убийц производительности WordPress7 убийц производительности WordPress
7 убийц производительности WordPress
 
WordPress под нагрузкой: масштабирование и отказоустойчивость
WordPress под нагрузкой: масштабирование и отказоустойчивостьWordPress под нагрузкой: масштабирование и отказоустойчивость
WordPress под нагрузкой: масштабирование и отказоустойчивость
 
Будущее WordPress (SPB, 2014)
Будущее WordPress (SPB, 2014)Будущее WordPress (SPB, 2014)
Будущее WordPress (SPB, 2014)
 
Road to Platform @ WordPress.com VIP Workshop 2014
Road to Platform @ WordPress.com VIP Workshop 2014Road to Platform @ WordPress.com VIP Workshop 2014
Road to Platform @ WordPress.com VIP Workshop 2014
 
Будущее WordPress
Будущее WordPressБудущее WordPress
Будущее WordPress
 
Templating WordPress
Templating WordPressTemplating WordPress
Templating WordPress
 
Как повысить скорость вашего сайта на WordPress
Как повысить скорость вашего сайта на WordPressКак повысить скорость вашего сайта на WordPress
Как повысить скорость вашего сайта на WordPress
 
Основые безопасности WordPress
Основые безопасности WordPressОсновые безопасности WordPress
Основые безопасности WordPress
 
Цикл разработки WordPress
Цикл разработки WordPressЦикл разработки WordPress
Цикл разработки WordPress
 
7 Tips for Better WordPress Theme Development
7 Tips for Better WordPress Theme Development7 Tips for Better WordPress Theme Development
7 Tips for Better WordPress Theme Development
 
The Settings API
The Settings APIThe Settings API
The Settings API
 
P2
P2P2
P2
 
Секреты WP_Query
Секреты WP_QueryСекреты WP_Query
Секреты WP_Query
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Things I Wish I Had Known Before Developing a WordPress Theme