SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Jonny Allbut Head of Digital - Tanc Design
@Jonnyauk | www.tancdesign.com
Build themes
like a Heavyweight
Howdy Campers!
Creative designer & developer
Working with WordPress since early 2005
Creator & lead developer of:
Wonderflux theme framework
WP-CMS Post Control
Tanc Dimensions Helper
Avid theme developer, intermediate PHP coder
Why build your own themes?
Build for purpose
Consistent development
No compromises
Build for the future
Performance
My theme build workflow
Establish business priorities
Rationalise content structure
Widgetise/menus/post types
Creative design
Layout coding
Custom functions
Extra views
Question...
“What are the big
trends in theme
design today?”
A starter for one...
RESPONSIVE!
The trouble with responsive
Huge audience
Layout and media content
Should we be designing mobile first?
Pixel perfection?
What's wrong with how it’s (often) done?
The quest for the holy grail
The shortcomings of the Wonderflux grid
Gutters are for drunks!
Browser detection
Extra browser classes on body tag
Moving div generation to 'relative' sized div PHP
function with responsive over-ride
Tanc responsive testbed
CSS tricks of the trade
Use/abuse the body class
<body <?php body_class('extraclass');?>>
Use/abuse the post class
<?php post_class('extraclass'); ?>>
Use what WordPress gives you for free
(if your themes built right!)
Useful CSS classes and ID's - post
.post
.page
.attachment
.sticky
.category-example
.size-full
.size-large
.size-medium
.size-thumbnail
.alignleft, img.alignleft
.alignright, img.alignright
.aligncenter, img.aligncenter
.alignnone, img.alignnone
Useful CSS classes and ID's - menus
.current_page_item
.current-cat
.current-menu-item
.menu-item-type-taxonomy
.menu-item-type-post_type
.menu-item-home
PHP tricks of the trade
is_page_template()
has_post_thumbnail()
Detecting last post
Adding your own image sizes
Checking if widget area populated
Custom walker class for menus
Testing for page template
if (is_page_template('template-2-column-sb-left.php')) {
//Means we need to go for wider columns
$columnsize = '18';
$columnsizecontent = '14';
} else {
//Normal columns
$columnsize = '12';
$columnsizecontent = '8';
}
Testing for post thumbnail
if ( !has_post_thumbnail() ) {
$this_img_single =
get_bloginfo('stylesheet_directory').
'/images/default-thumbnail.jpg';
}
Detecting last post
if( ($wp_query->current_post + 1) < ($wp_query-
>post_count) ): echo ‘This is the end!’;
Adding image sizes
add_image_size( 'special-image', 600, 600, true );
function mywfx_img_sizes( $sizes ) {
$custom_sizes = array('special-image' => 'Special Image');
! return array_merge( $sizes, $custom_sizes );
}
add_filter( 'image_size_names_choose', 'mywfx_img_sizes' );
Is widget area populated?
if ( is_active_sidebar( 'footer-right' ) ):
! echo ‘<div class="footer-utilities">’;
! ! <?php dynamic_sidebar( 'footer-right' ); ?>
! echo ‘</div>’;
else:
! echo ‘<div class="footer-utilities">’;
! ! <p>I got no widgets, boo!</p>
! echo ‘</div>’;
<?php endif; ?>
Useful hooks for theme developers
after_setup_theme
template_redirect
pre_get_posts
Theme testing and debugging
Debugging on:
define('WP_DEBUG', true);
Theme unit test data:
http://codex.wordpress.org/Theme_Unit_Test
Developer plugin
http://wordpress.org/plugins/developer
Virtual machines
http://www.modern.ie
Adobe Edge Inspect / Ghostlab
IETester
The effects of not testing
throughout your design process
All criticism, ideas and
patches welcome!
www.wonderflux.com
@Wonderflux
Jonny Allbut Head of Digital - Tanc Design
@Jonnyauk | www.tancdesign.com

Weitere ähnliche Inhalte

Was ist angesagt?

Features in love
Features in loveFeatures in love
Features in lovebmeme
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Developmentmwrather
 
WooCommerce Customization Masterclass (WordCamp Dublin 2017)
WooCommerce Customization Masterclass (WordCamp Dublin 2017)WooCommerce Customization Masterclass (WordCamp Dublin 2017)
WooCommerce Customization Masterclass (WordCamp Dublin 2017)Rodolfo Melogli
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Jazkarta, Inc.
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017Morten Rand-Hendriksen
 
Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Damien Carbery
 
WordPress 15th Meetup - Build a Child Theme
WordPress 15th Meetup - Build a Child ThemeWordPress 15th Meetup - Build a Child Theme
WordPress 15th Meetup - Build a Child ThemeFadi Nicolas Zahhar
 
We're on a Mission: WordPress for Non-Profits
We're on a Mission: WordPress for Non-ProfitsWe're on a Mission: WordPress for Non-Profits
We're on a Mission: WordPress for Non-ProfitsJohn Eckman
 
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16Jeseph Meyers
 
Intro to wordpress short course
Intro to wordpress short courseIntro to wordpress short course
Intro to wordpress short coursecarishurd
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Amanda Giles
 
光速テーマ開発のコツ
光速テーマ開発のコツ光速テーマ開発のコツ
光速テーマ開発のコツHishikawa Takuro
 
Creating Themes for Clients
Creating Themes for ClientsCreating Themes for Clients
Creating Themes for ClientsJean Felisme
 
WooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP SnippetsWooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP SnippetsRodolfo Melogli
 
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011Kathryn Presner
 
How to Jazz Up Your WordPress Site – without a lick o’ code
How to Jazz Up Your WordPress Site – without a lick o’ codeHow to Jazz Up Your WordPress Site – without a lick o’ code
How to Jazz Up Your WordPress Site – without a lick o’ codeKathryn Presner
 

Was ist angesagt? (20)

Features in love
Features in loveFeatures in love
Features in love
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
WooCommerce Customization Masterclass (WordCamp Dublin 2017)
WooCommerce Customization Masterclass (WordCamp Dublin 2017)WooCommerce Customization Masterclass (WordCamp Dublin 2017)
WooCommerce Customization Masterclass (WordCamp Dublin 2017)
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
 
Wordpress as a CMS
Wordpress as a CMSWordpress as a CMS
Wordpress as a CMS
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
 
Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017
 
Agile Wordpress
Agile WordpressAgile Wordpress
Agile Wordpress
 
WordPress 15th Meetup - Build a Child Theme
WordPress 15th Meetup - Build a Child ThemeWordPress 15th Meetup - Build a Child Theme
WordPress 15th Meetup - Build a Child Theme
 
We're on a Mission: WordPress for Non-Profits
We're on a Mission: WordPress for Non-ProfitsWe're on a Mission: WordPress for Non-Profits
We're on a Mission: WordPress for Non-Profits
 
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
 
Intro to wordpress short course
Intro to wordpress short courseIntro to wordpress short course
Intro to wordpress short course
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?
 
光速テーマ開発のコツ
光速テーマ開発のコツ光速テーマ開発のコツ
光速テーマ開発のコツ
 
Creating Themes for Clients
Creating Themes for ClientsCreating Themes for Clients
Creating Themes for Clients
 
WooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP SnippetsWooCommerce: How to Customize WordPress via PHP Snippets
WooCommerce: How to Customize WordPress via PHP Snippets
 
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
 
Meet The Family
Meet The FamilyMeet The Family
Meet The Family
 
How to Jazz Up Your WordPress Site – without a lick o’ code
How to Jazz Up Your WordPress Site – without a lick o’ codeHow to Jazz Up Your WordPress Site – without a lick o’ code
How to Jazz Up Your WordPress Site – without a lick o’ code
 

Ähnlich wie Build WordPress themes like a heavyweight - WordCamp Lancaster 2013

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress WebsitesKyle Cearley
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPrandyhoyt
 
Theme development workflow
Theme development workflowTheme development workflow
Theme development workflowShameem Reza
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 Evan Mullins
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...Denise Williams
 
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 2011David Carr
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressJesse James Arnold
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Peter Martin
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and pluginsStephanie Wells
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshopArjen Miedema
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes ramakesavan
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)Beau Lebens
 

Ähnlich wie Build WordPress themes like a heavyweight - WordCamp Lancaster 2013 (20)

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
 
Theme development workflow
Theme development workflowTheme development workflow
Theme development workflow
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
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
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPress
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and plugins
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshop
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 

Mehr von Jonny Allbut

WordCamp Bristol 2019 - WordPress custom theme building
WordCamp Bristol 2019 - WordPress custom theme buildingWordCamp Bristol 2019 - WordPress custom theme building
WordCamp Bristol 2019 - WordPress custom theme buildingJonny Allbut
 
Your Online Marketing 
& Social Media Toolkit - Wider
Your Online Marketing 
& Social Media Toolkit - WiderYour Online Marketing 
& Social Media Toolkit - Wider
Your Online Marketing 
& Social Media Toolkit - WiderJonny Allbut
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterJonny Allbut
 
How to use WordPress
How to use WordPressHow to use WordPress
How to use WordPressJonny Allbut
 
How to create and develop a winning brand
How to create and develop a winning brandHow to create and develop a winning brand
How to create and develop a winning brandJonny Allbut
 
Turbo charged WordPress theme development - WordCamp Edinburgh 2012
Turbo charged WordPress theme development - WordCamp Edinburgh 2012Turbo charged WordPress theme development - WordCamp Edinburgh 2012
Turbo charged WordPress theme development - WordCamp Edinburgh 2012Jonny Allbut
 
Freelance presentation v2
Freelance presentation v2Freelance presentation v2
Freelance presentation v2Jonny Allbut
 
Wordcamp 2010 presentation
Wordcamp 2010 presentationWordcamp 2010 presentation
Wordcamp 2010 presentationJonny Allbut
 
WordCamp UK 2009 presentation
WordCamp UK 2009 presentationWordCamp UK 2009 presentation
WordCamp UK 2009 presentationJonny Allbut
 
WordPress Is Not A Blog from WordCamp UK 2008
WordPress Is Not A Blog from WordCamp UK 2008WordPress Is Not A Blog from WordCamp UK 2008
WordPress Is Not A Blog from WordCamp UK 2008Jonny Allbut
 

Mehr von Jonny Allbut (10)

WordCamp Bristol 2019 - WordPress custom theme building
WordCamp Bristol 2019 - WordPress custom theme buildingWordCamp Bristol 2019 - WordPress custom theme building
WordCamp Bristol 2019 - WordPress custom theme building
 
Your Online Marketing 
& Social Media Toolkit - Wider
Your Online Marketing 
& Social Media Toolkit - WiderYour Online Marketing 
& Social Media Toolkit - Wider
Your Online Marketing 
& Social Media Toolkit - Wider
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus Smarter
 
How to use WordPress
How to use WordPressHow to use WordPress
How to use WordPress
 
How to create and develop a winning brand
How to create and develop a winning brandHow to create and develop a winning brand
How to create and develop a winning brand
 
Turbo charged WordPress theme development - WordCamp Edinburgh 2012
Turbo charged WordPress theme development - WordCamp Edinburgh 2012Turbo charged WordPress theme development - WordCamp Edinburgh 2012
Turbo charged WordPress theme development - WordCamp Edinburgh 2012
 
Freelance presentation v2
Freelance presentation v2Freelance presentation v2
Freelance presentation v2
 
Wordcamp 2010 presentation
Wordcamp 2010 presentationWordcamp 2010 presentation
Wordcamp 2010 presentation
 
WordCamp UK 2009 presentation
WordCamp UK 2009 presentationWordCamp UK 2009 presentation
WordCamp UK 2009 presentation
 
WordPress Is Not A Blog from WordCamp UK 2008
WordPress Is Not A Blog from WordCamp UK 2008WordPress Is Not A Blog from WordCamp UK 2008
WordPress Is Not A Blog from WordCamp UK 2008
 

Kürzlich hochgeladen

AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - MorgenboosterAI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster1508 A/S
 
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...Pranav Subramanian
 
guest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssguest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssNadaMohammed714321
 
ArtWaves 2024 - embracing Curves in Modern Homes
ArtWaves 2024 - embracing Curves in Modern HomesArtWaves 2024 - embracing Curves in Modern Homes
ArtWaves 2024 - embracing Curves in Modern HomesVellyslav Petrov
 
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...Yantram Animation Studio Corporation
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designersPixeldarts
 
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfsimpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfLucyBonelli
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Associazione Digital Days
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024digital learning point
 
Map of St. Louis Parks
Map of St. Louis Parks                              Map of St. Louis Parks
Map of St. Louis Parks CharlottePulte
 
CAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfCAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfAlasAlthaher
 
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...Thomas Schielke
 
Imagist3D Architectural and Interior Rendering Portfolio
Imagist3D Architectural and Interior Rendering PortfolioImagist3D Architectural and Interior Rendering Portfolio
Imagist3D Architectural and Interior Rendering PortfolioAlinaLau2
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioRMG Project Studio
 
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...Pranav Subramanian
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine CharlottePulte
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptJIT KUMAR GUPTA
 
guest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssguest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssNadaMohammed714321
 
FW25-26 Knit Cut & Sew Trend Book Peclers Paris
FW25-26 Knit Cut & Sew Trend Book Peclers ParisFW25-26 Knit Cut & Sew Trend Book Peclers Paris
FW25-26 Knit Cut & Sew Trend Book Peclers ParisPeclers Paris
 

Kürzlich hochgeladen (20)

AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - MorgenboosterAI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
 
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...
LIGHTSCAPES: HOW MIGHT WE DESIGN AN INCLUSIVE AND ACCESSIBLE CLASSICAL CONCER...
 
guest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssguest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssss
 
ArtWaves 2024 - embracing Curves in Modern Homes
ArtWaves 2024 - embracing Curves in Modern HomesArtWaves 2024 - embracing Curves in Modern Homes
ArtWaves 2024 - embracing Curves in Modern Homes
 
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...
Exploring Tehran's Architectural Marvels: A Glimpse into Vilaas Studio's Dyna...
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers
 
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfsimpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024
 
Map of St. Louis Parks
Map of St. Louis Parks                              Map of St. Louis Parks
Map of St. Louis Parks
 
CAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfCAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdf
 
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...
Cities Light Up in Solidarity With Ukraine: From Internationally Synchronized...
 
Imagist3D Architectural and Interior Rendering Portfolio
Imagist3D Architectural and Interior Rendering PortfolioImagist3D Architectural and Interior Rendering Portfolio
Imagist3D Architectural and Interior Rendering Portfolio
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project Studio
 
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...
STITCH: HOW MIGHT WE PROMOTE AN EQUITABLE AND INCLUSIVE URBAN LIFESTYLE PRIOR...
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
 
guest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssguest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssss
 
ASME B31.4-2022 estandar ductos año 2022
ASME B31.4-2022 estandar ductos año 2022ASME B31.4-2022 estandar ductos año 2022
ASME B31.4-2022 estandar ductos año 2022
 
FW25-26 Knit Cut & Sew Trend Book Peclers Paris
FW25-26 Knit Cut & Sew Trend Book Peclers ParisFW25-26 Knit Cut & Sew Trend Book Peclers Paris
FW25-26 Knit Cut & Sew Trend Book Peclers Paris
 

Build WordPress themes like a heavyweight - WordCamp Lancaster 2013

  • 1. Jonny Allbut Head of Digital - Tanc Design @Jonnyauk | www.tancdesign.com Build themes like a Heavyweight
  • 2. Howdy Campers! Creative designer & developer Working with WordPress since early 2005 Creator & lead developer of: Wonderflux theme framework WP-CMS Post Control Tanc Dimensions Helper Avid theme developer, intermediate PHP coder
  • 3. Why build your own themes? Build for purpose Consistent development No compromises Build for the future Performance
  • 4. My theme build workflow Establish business priorities Rationalise content structure Widgetise/menus/post types Creative design Layout coding Custom functions Extra views
  • 5. Question... “What are the big trends in theme design today?”
  • 6. A starter for one... RESPONSIVE!
  • 7. The trouble with responsive Huge audience Layout and media content Should we be designing mobile first? Pixel perfection? What's wrong with how it’s (often) done?
  • 8. The quest for the holy grail The shortcomings of the Wonderflux grid Gutters are for drunks! Browser detection Extra browser classes on body tag Moving div generation to 'relative' sized div PHP function with responsive over-ride
  • 10. CSS tricks of the trade Use/abuse the body class <body <?php body_class('extraclass');?>> Use/abuse the post class <?php post_class('extraclass'); ?>> Use what WordPress gives you for free (if your themes built right!)
  • 11. Useful CSS classes and ID's - post .post .page .attachment .sticky .category-example .size-full .size-large .size-medium .size-thumbnail .alignleft, img.alignleft .alignright, img.alignright .aligncenter, img.aligncenter .alignnone, img.alignnone
  • 12. Useful CSS classes and ID's - menus .current_page_item .current-cat .current-menu-item .menu-item-type-taxonomy .menu-item-type-post_type .menu-item-home
  • 13. PHP tricks of the trade is_page_template() has_post_thumbnail() Detecting last post Adding your own image sizes Checking if widget area populated Custom walker class for menus
  • 14. Testing for page template if (is_page_template('template-2-column-sb-left.php')) { //Means we need to go for wider columns $columnsize = '18'; $columnsizecontent = '14'; } else { //Normal columns $columnsize = '12'; $columnsizecontent = '8'; }
  • 15. Testing for post thumbnail if ( !has_post_thumbnail() ) { $this_img_single = get_bloginfo('stylesheet_directory'). '/images/default-thumbnail.jpg'; }
  • 16. Detecting last post if( ($wp_query->current_post + 1) < ($wp_query- >post_count) ): echo ‘This is the end!’;
  • 17. Adding image sizes add_image_size( 'special-image', 600, 600, true ); function mywfx_img_sizes( $sizes ) { $custom_sizes = array('special-image' => 'Special Image'); ! return array_merge( $sizes, $custom_sizes ); } add_filter( 'image_size_names_choose', 'mywfx_img_sizes' );
  • 18. Is widget area populated? if ( is_active_sidebar( 'footer-right' ) ): ! echo ‘<div class="footer-utilities">’; ! ! <?php dynamic_sidebar( 'footer-right' ); ?> ! echo ‘</div>’; else: ! echo ‘<div class="footer-utilities">’; ! ! <p>I got no widgets, boo!</p> ! echo ‘</div>’; <?php endif; ?>
  • 19. Useful hooks for theme developers after_setup_theme template_redirect pre_get_posts
  • 20. Theme testing and debugging Debugging on: define('WP_DEBUG', true); Theme unit test data: http://codex.wordpress.org/Theme_Unit_Test Developer plugin http://wordpress.org/plugins/developer Virtual machines http://www.modern.ie Adobe Edge Inspect / Ghostlab IETester
  • 21. The effects of not testing throughout your design process
  • 22. All criticism, ideas and patches welcome! www.wonderflux.com @Wonderflux Jonny Allbut Head of Digital - Tanc Design @Jonnyauk | www.tancdesign.com