SlideShare a Scribd company logo
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

More Related Content

What's hot

Features in love
Features in loveFeatures in love
Features in love
bmeme
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
mwrather
 
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.
 
Wordpress as a CMS
Wordpress as a CMSWordpress as a CMS
Wordpress as a CMS
Brad Touesnard
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
Amanda 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 2017
Morten Rand-Hendriksen
 
Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017Child Themes - WordCamp Dublin 2017
Child Themes - WordCamp Dublin 2017
Damien Carbery
 
Agile Wordpress
Agile WordpressAgile Wordpress
Agile Wordpress
Filippo Dino
 
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
Fadi 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-Profits
John 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 - #WCTO16
Jeseph Meyers
 
Intro to wordpress short course
Intro to wordpress short courseIntro to wordpress short course
Intro to wordpress short course
carishurd
 
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 Clients
Jean 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 Snippets
Rodolfo 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 2011
Kathryn Presner
 
Meet The Family
Meet The FamilyMeet The Family
Meet The Family
Beau Lebens
 
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
Kathryn Presner
 

What's hot (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
 

Similar to Build WordPress themes like a heavyweight - WordCamp Lancaster 2013

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
Kyle Cearley
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
randyhoyt
 
Theme development workflow
Theme development workflowTheme development workflow
Theme development workflow
Shameem 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 2011
David 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 WordPress
Nile Flores
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
Ryan Price
 
Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPress
Jesse James Arnold
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
Amanda 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 2016
Peter Martin
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
Yoav Farhi
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
James Panton
 
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
Stephanie Wells
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshop
Arjen 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 Company
Marcos 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 symfony
Francois Zaninotto
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens
 

Similar to 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)
 

More from 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 building
Jonny 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 - Wider
Jonny 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 Smarter
Jonny Allbut
 
How to use WordPress
How to use WordPressHow to use WordPress
How to use WordPress
Jonny 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 brand
Jonny 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 2012
Jonny Allbut
 
Freelance presentation v2
Freelance presentation v2Freelance presentation v2
Freelance presentation v2
Jonny Allbut
 
Wordcamp 2010 presentation
Wordcamp 2010 presentationWordcamp 2010 presentation
Wordcamp 2010 presentation
Jonny Allbut
 
WordCamp UK 2009 presentation
WordCamp UK 2009 presentationWordCamp UK 2009 presentation
WordCamp UK 2009 presentation
Jonny 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 2008
Jonny Allbut
 

More from 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
 

Recently uploaded

Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
eloprejohn333
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
millarj46
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
Knight Moves
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
qo1as76n
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
GOWSIKRAJA PALANISAMY
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
talaatahm
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
TE Studio
 
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
pmgdscunsri
 
Revolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in IndiaRevolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in India
amrsoftec1
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
kecekev
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
Febless Hernane
 
Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1
Decomart Studio
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
Techno Merch
 
ZAPATILLAS 2 X 110 ABRIL.pdf compra economico
ZAPATILLAS 2 X 110 ABRIL.pdf compra economicoZAPATILLAS 2 X 110 ABRIL.pdf compra economico
ZAPATILLAS 2 X 110 ABRIL.pdf compra economico
jhonguerrerobarturen
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
Virtual Real Design
 

Recently uploaded (20)

Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
 
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
 
Revolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in IndiaRevolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in India
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
 
Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
 
ZAPATILLAS 2 X 110 ABRIL.pdf compra economico
ZAPATILLAS 2 X 110 ABRIL.pdf compra economicoZAPATILLAS 2 X 110 ABRIL.pdf compra economico
ZAPATILLAS 2 X 110 ABRIL.pdf compra economico
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
 

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