SlideShare una empresa de Scribd logo
1 de 53
Theme Development *For the seasoned WordPress developer or anyone coding in PHP, CSS, and jQuery.
Hello! I'm Brendan Sera-Shriar A.K.A.  digibomb , a WP hacker, designer, blogger, social addict, techy, and published author from Montreal, Canada.
What is  ? … and it’s  FREE
Where do I find  ?
This number changes every few minutes. 8, 000, 000  People publish blogs on WordPress.com 200 million people visit one or more WordPress.com blogs every month.
, NOT just a blog anymore!
 
 
 
 
 
 
 
 
 
Theming   ,[object Object]
Theming   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Theming   How it all works If you go to the default theme folder ( wp-content/themes/default ),  you will see many PHP files (these are template files) and one  style.css  file. When you are viewing the front page, WordPress  actually uses several template files to generate the page  ( index.php  ,  header.php ,  sidebar.php , and  footer.php ).
Theming
Theming   Splitting the file
Theming   Styles.css /* Theme Name: Theme NAME Theme URI: http://yoursite.com/ Description: My cool theme. Version: 1.6 Author: Brendan Sera-Shriar Author URI: http://dropthedigibomb.com */ body { … } H1, h2, h3 { … } #header { … } #content { … } #sidebar { … } #footer { … } .post { … } .comments { … } } This defines the  template theme } Theme id’s and classes
Templating   Let’s start with the Template System Template Tags Conditional Tags PHP Function Calls
Templating   <?php  // syntax #1: curly braces  if ( condition to check ){  // code to execute if the condition is true  }  // syntax #2: colon and endif  if ( condition to check ):  // code to execute if the condition is true  endif;  ?> <?php if ( is_home() ): ?>  <h3>Main Page</h3>  <?php elseif( is_archive() ): ?>  <h3>Archives Page</h3>  <?php else: ?>  <h3>Welcome to my blog!!</h3> <?php endif; ?> Standard PHP WordPress
Templating   ,[object Object],[object Object],[object Object],[object Object],[object Object],Going beyond just a blog
Templating   The Loop The Loop is used to display posts and it also lets you  control how/what to display. Basically, The Loop checks if there  are posts in your blog, while there are posts, display it, if no  posts found, say &quot;Not Found“ or something else.
Templating   A complete template In this example we are using some standard Template Tags to display the title of the post  the_title()  and we are linking it using  the_permalink()  . We display  the_date()  and  the_content()  . Finally for fun we call  link_pages() .
Theming   <?php query_posts(&quot;showposts=8&cat=10&quot;); ?> <?php while (have_posts()) : the_post(); ?> Playing with the loop <?php query_posts(&quot;showposts=8&cat=-5,-6,-10&quot;); ?> <?php while (have_posts()) : the_post(); ?> or
Templating   Playing with the code <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?> Most blogs display categories somewhere, usually the side bar.  The easiest way to do this is with the  wp_list_categories()  Template Tag.
Templating   Playing with the code <ul>  <li id=&quot;categories&quot;>  <?php wp_dropdown_categories('title_li=&hierarchical=0&show_count=1&child_of=9'); ?> <script type=&quot;text/javascript&quot;> <!-- var dropdown = document.getElementById(&quot;cat&quot;); function onCatChange() { if (  dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = &quot;<?php echo get_option('home'); ?>/?cat=&quot;+dropdown.options[dropdown.selectedIndex].value; } }  dropdown.onchange = onCatChange; --> </script>  </li>  </ul>  What if I wanted to display specific categories and have them in a dropdown box? * See the full tutorial at  dropthedigibomb.com
Templating   Playing with the code <?php if(is_page(&quot;landing&quot;)) : ?> <h5 class=&quot;tagline&quot;>  Hello! I'm Brendan Sera-Shriar A.K.A. <span  class=&quot;blue&quot;>digibomb</span>, a freelance web designer from  Montreal, Canada. </h5> <?php elseif(is_page(&quot;work&quot;) || is_page(&quot;branding&quot;) ||  is_page(&quot;other-projects&quot;) || is_page(&quot;client-list&quot;)) : ?> <h5 class=&quot;tagline&quot;>  I don't just build <span class=&quot;blue&quot;>websites</span> I build <span  class=&quot;blue&quot;>communities</span>! </h5> <?php endif; ?> What if I wanted to display different taglines on each page? * See it in action at  digibombinc.com
Theming   Custom Post/Pages We’ve already looked at the basic template files that make up WordPress … but, if we want to go beyond the blog we need more!  ,[object Object],[object Object],[object Object],[object Object],and ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Theming   Custom Post/Pages Creating your own template files is the most powerful way to gain full control over how your WordPress site looks, feels, and functions…and it’s really easy too! Creating your template: The best way to start is by modifying an existing template, like single.php or page.php.
Theming   Custom Post/Pages <?php /* Template Name: blog */ ?> <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> etc….  } This defines the template
Theming   <?php if ( is_home() ) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/home.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } elseif( is_page(&quot;blog&quot;)) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/blog.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } elseif( in_category(&quot;tutorials&quot;) ) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/tuts.css&quot; type=&quot;text/css“ <?php } else { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('stylesheet_url'); ?>&quot;  type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } ?> Alternate Stylesheets * See it in action at  créer magazine
Templating   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Integrating jQuery <?php wp_enqueue_script(&quot;jquery&quot;); ?>
Templating   ,[object Object],[object Object],Integrating jQuery <script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;></script>
Templating   ,[object Object],[object Object],[object Object],Integrating jQuery <script type=&quot;text/javascript&quot; src=&quot;<?php bloginfo('template_directory'); ?>/includes/js/jquery.js&quot;></script>
Templating   Very simple slider Integrating jQuery <script src=&quot;http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js&quot;></script> Load jQuery <div class=&quot;panes&quot;> <div> <?php query_posts(&quot;cat=1&quot;); ?> <?php while (have_posts()) : the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> </div> Load jQuery
Templating   Very simple slider That’s it! Integrating jQuery <script> // perform JavaScript after the document is scriptable. $(function() { // setup ul.tabs to work as tabs for each div directly under div.panes $(&quot;ul.tabs&quot;).tabs(&quot;div.panes > div&quot;); }); </script> Activate the tabs
Templating   Integrating jQuery More  jQuery Examples
Templating   The Dashboard ,[object Object],[object Object],[object Object],[object Object],* See the full tutorial at  dropthedigibomb.com
Templating   The Dashboard Custom login function my_custom_login_logo() { echo '<style type=&quot;text/css&quot;> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } </style>'; } add_action('login_head', 'my_custom_login_logo');
Templating   The Dashboard Custom logo function my_custom_logo() { echo '<style type=&quot;text/css&quot;> #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/dash_logo.png) !important; }</style>'; } add_action('admin_head', 'my_custom_logo');
Templating   The Dashboard Custom widget add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_ad_widget', 'Ads', 'custom_dashboard_ad'); } function custom_dashboard_ad() { echo '<p>Check out some other cool stuff</p><br /><img src=&quot;http://www.webdesignerwall.com/wp-content/uploads/2010/01/p2h-banner.jpg&quot; />'; }
Extending BuddyPress is a suite of WordPress  plugins and themes, each adding a  distinct new feature. BuddyPress  contains all the features you’d expect  from WordPress but aims to let members  socially interact. http://buddypress.org/   WordPress MU, or multi-user, is designed to  do exactly that. It is most famously used for  WordPress.com  where it serves tens of millions  of hits on millions of blogs each day. http://mu.wordpress.org/
Extending When a visitor browses to a WordPress.com blog on a  mobile device we show special themes designed to work  on small screens focussing on fast load times. The first  theme is a modification of  WPtouch  and is displayed to  phones with rich web browsers like the iPhone and Android  phones. The second theme was developed from an old  version of the  WordPress Mobile Edition  and will be displayed  to all other mobile devices.
Mobile Install
Theming   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],* See my presentation on  WordPress Theme Design
Essential  Plugins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Essential  Plugins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
ematrix
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
Jon Dean
 
ARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: PublishingARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: Publishing
Gilbert Guerrero
 

La actualidad más candente (20)

Joomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design PresentationJoomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design Presentation
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
BYOWHC823
BYOWHC823BYOWHC823
BYOWHC823
 
Progressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQueryProgressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQuery
 
Html5 accessibility
Html5 accessibilityHtml5 accessibility
Html5 accessibility
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
 
Html5 ux london
Html5 ux londonHtml5 ux london
Html5 ux london
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
You and Your Stylesheet
You and Your StylesheetYou and Your Stylesheet
You and Your Stylesheet
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 
Use atomic design ftw
Use atomic design ftwUse atomic design ftw
Use atomic design ftw
 
ARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: PublishingARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: Publishing
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs
 
Microformats at Web 2.0 Expo April 2007
Microformats at Web 2.0 Expo April 2007Microformats at Web 2.0 Expo April 2007
Microformats at Web 2.0 Expo April 2007
 

Destacado

Cv L.S.Bhandary Eng
Cv L.S.Bhandary EngCv L.S.Bhandary Eng
Cv L.S.Bhandary Eng
lbhandary
 
How to Turn Your Website into a Sales funnel
How to Turn Your Website into a Sales funnelHow to Turn Your Website into a Sales funnel
How to Turn Your Website into a Sales funnel
Jason Rudland
 
Laser Imaging Fluorescence Endoscopy
Laser Imaging Fluorescence EndoscopyLaser Imaging Fluorescence Endoscopy
Laser Imaging Fluorescence Endoscopy
WEN-TE LIU
 
Best Free Software
Best Free SoftwareBest Free Software
Best Free Software
dnunezaj
 
TổNg KếT NăM HọC 2008
TổNg KếT NăM HọC 2008TổNg KếT NăM HọC 2008
TổNg KếT NăM HọC 2008
guestd9ddd7b
 
Expressionism (final version)
Expressionism (final version)Expressionism (final version)
Expressionism (final version)
Patricia Guzman
 

Destacado (20)

5, 4, 3, 2, 1: The Code to Better Compensation Planning
5, 4, 3, 2, 1:  The Code to Better Compensation Planning5, 4, 3, 2, 1:  The Code to Better Compensation Planning
5, 4, 3, 2, 1: The Code to Better Compensation Planning
 
Xna Demo.Ppt
Xna Demo.PptXna Demo.Ppt
Xna Demo.Ppt
 
Cv L.S.Bhandary Eng
Cv L.S.Bhandary EngCv L.S.Bhandary Eng
Cv L.S.Bhandary Eng
 
How to Turn Your Website into a Sales funnel
How to Turn Your Website into a Sales funnelHow to Turn Your Website into a Sales funnel
How to Turn Your Website into a Sales funnel
 
Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...
Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...
Regulatory, Technical and Modeling Challenges to Developing a Frequency Based...
 
Laser Imaging Fluorescence Endoscopy
Laser Imaging Fluorescence EndoscopyLaser Imaging Fluorescence Endoscopy
Laser Imaging Fluorescence Endoscopy
 
Information Skills: 6. Disability Support (Natural Sciences, Bangor University)
Information Skills: 6. Disability Support (Natural Sciences, Bangor University)Information Skills: 6. Disability Support (Natural Sciences, Bangor University)
Information Skills: 6. Disability Support (Natural Sciences, Bangor University)
 
Best Free Software
Best Free SoftwareBest Free Software
Best Free Software
 
Indy 2009
Indy 2009Indy 2009
Indy 2009
 
Make Web, Not War - Open Source Microsoft Event
Make Web, Not War - Open Source Microsoft EventMake Web, Not War - Open Source Microsoft Event
Make Web, Not War - Open Source Microsoft Event
 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
 
Green Buildings - A Primer on Green Building and LEED
Green Buildings - A Primer on Green Building and LEEDGreen Buildings - A Primer on Green Building and LEED
Green Buildings - A Primer on Green Building and LEED
 
Perception of Public Works - APWA Conference
Perception of Public Works - APWA Conference Perception of Public Works - APWA Conference
Perception of Public Works - APWA Conference
 
Krishnan V Resume
Krishnan V ResumeKrishnan V Resume
Krishnan V Resume
 
TổNg KếT NăM HọC 2008
TổNg KếT NăM HọC 2008TổNg KếT NăM HọC 2008
TổNg KếT NăM HọC 2008
 
Jjansen networked consumer_2011
Jjansen networked consumer_2011Jjansen networked consumer_2011
Jjansen networked consumer_2011
 
Customer Relations
Customer RelationsCustomer Relations
Customer Relations
 
Expressionism (final version)
Expressionism (final version)Expressionism (final version)
Expressionism (final version)
 
Green Stormwater: LID with GIS
Green Stormwater: LID with GISGreen Stormwater: LID with GIS
Green Stormwater: LID with GIS
 
AAUP Growing Sales Slides
AAUP Growing Sales SlidesAAUP Growing Sales Slides
AAUP Growing Sales Slides
 

Similar a WordPress Development Confoo 2010

Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
Magecom Ukraine
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
maycourse
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
StarTech Conference
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
Marek Sotak
 

Similar a WordPress Development Confoo 2010 (20)

عرض حول وردبريس
عرض حول وردبريسعرض حول وردبريس
عرض حول وردبريس
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPress
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop API
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
WordPress development paradigms, idiosyncrasies and other big words
WordPress development paradigms, idiosyncrasies and other big wordsWordPress development paradigms, idiosyncrasies and other big words
WordPress development paradigms, idiosyncrasies and other big words
 
Html5
Html5Html5
Html5
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
APEX Themes and Templates
APEX Themes and TemplatesAPEX Themes and Templates
APEX Themes and Templates
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
CSS Best practices
CSS Best practicesCSS Best practices
CSS Best practices
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 

Más de Brendan Sera-Shriar

SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
Brendan Sera-Shriar
 
Building a Mega Community with PressWork
Building a Mega Community with PressWorkBuilding a Mega Community with PressWork
Building a Mega Community with PressWork
Brendan Sera-Shriar
 

Más de Brendan Sera-Shriar (18)

How to A/B Test with WordPress: Conversions Aren’t Just for Landing Pages
How to A/B Test with WordPress: Conversions Aren’t Just for Landing PagesHow to A/B Test with WordPress: Conversions Aren’t Just for Landing Pages
How to A/B Test with WordPress: Conversions Aren’t Just for Landing Pages
 
Build a Responsive WordPress Theme with Zurbs Foundation Framework
Build a Responsive WordPress Theme with Zurbs Foundation FrameworkBuild a Responsive WordPress Theme with Zurbs Foundation Framework
Build a Responsive WordPress Theme with Zurbs Foundation Framework
 
SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
SEO Is Dead. Long Live SEO - SEO Camp Montreal 2013
 
The Evolution of Live Preview Environment Design
The Evolution of Live Preview Environment DesignThe Evolution of Live Preview Environment Design
The Evolution of Live Preview Environment Design
 
Building a Mega Community with PressWork
Building a Mega Community with PressWorkBuilding a Mega Community with PressWork
Building a Mega Community with PressWork
 
Building a community around your blog v3
Building a community around your blog v3Building a community around your blog v3
Building a community around your blog v3
 
Building a Community Around your Blog 2 - Let the Comments be your Content!
Building a Community Around your Blog 2 - Let the Comments be your Content!Building a Community Around your Blog 2 - Let the Comments be your Content!
Building a Community Around your Blog 2 - Let the Comments be your Content!
 
Building a Community Around your Blog
Building a Community Around your BlogBuilding a Community Around your Blog
Building a Community Around your Blog
 
Migrate, Grow, and Cultivate your Community
Migrate, Grow, and Cultivate your CommunityMigrate, Grow, and Cultivate your Community
Migrate, Grow, and Cultivate your Community
 
An Introduction to Vanilla Forums - FSOSS 2010
An Introduction to Vanilla Forums - FSOSS 2010An Introduction to Vanilla Forums - FSOSS 2010
An Introduction to Vanilla Forums - FSOSS 2010
 
Adding Vanilla to WordPress
Adding Vanilla to WordPressAdding Vanilla to WordPress
Adding Vanilla to WordPress
 
It’s a WIN, WIN: ‘WordPress On Windows’
It’s a WIN, WIN: ‘WordPress On Windows’It’s a WIN, WIN: ‘WordPress On Windows’
It’s a WIN, WIN: ‘WordPress On Windows’
 
Wordpress To Go Democamp Mtl2009
Wordpress To Go Democamp Mtl2009Wordpress To Go Democamp Mtl2009
Wordpress To Go Democamp Mtl2009
 
Red5 - PHUG Workshops
Red5 - PHUG WorkshopsRed5 - PHUG Workshops
Red5 - PHUG Workshops
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
 
Open Source Design - FSOSS 2008
Open Source Design - FSOSS 2008Open Source Design - FSOSS 2008
Open Source Design - FSOSS 2008
 
PHUG - Open Source Culture
PHUG - Open Source CulturePHUG - Open Source Culture
PHUG - Open Source Culture
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

WordPress Development Confoo 2010

  • 1. Theme Development *For the seasoned WordPress developer or anyone coding in PHP, CSS, and jQuery.
  • 2. Hello! I'm Brendan Sera-Shriar A.K.A. digibomb , a WP hacker, designer, blogger, social addict, techy, and published author from Montreal, Canada.
  • 3. What is ? … and it’s FREE
  • 4. Where do I find ?
  • 5. This number changes every few minutes. 8, 000, 000 People publish blogs on WordPress.com 200 million people visit one or more WordPress.com blogs every month.
  • 6. , NOT just a blog anymore!
  • 7.  
  • 8.  
  • 9.  
  • 10.  
  • 11.  
  • 12.  
  • 13.  
  • 14.  
  • 15.  
  • 16.
  • 17.
  • 18. Theming How it all works If you go to the default theme folder ( wp-content/themes/default ), you will see many PHP files (these are template files) and one style.css file. When you are viewing the front page, WordPress actually uses several template files to generate the page ( index.php , header.php , sidebar.php , and footer.php ).
  • 20. Theming Splitting the file
  • 21. Theming Styles.css /* Theme Name: Theme NAME Theme URI: http://yoursite.com/ Description: My cool theme. Version: 1.6 Author: Brendan Sera-Shriar Author URI: http://dropthedigibomb.com */ body { … } H1, h2, h3 { … } #header { … } #content { … } #sidebar { … } #footer { … } .post { … } .comments { … } } This defines the template theme } Theme id’s and classes
  • 22. Templating Let’s start with the Template System Template Tags Conditional Tags PHP Function Calls
  • 23. Templating <?php // syntax #1: curly braces if ( condition to check ){ // code to execute if the condition is true } // syntax #2: colon and endif if ( condition to check ): // code to execute if the condition is true endif; ?> <?php if ( is_home() ): ?> <h3>Main Page</h3> <?php elseif( is_archive() ): ?> <h3>Archives Page</h3> <?php else: ?> <h3>Welcome to my blog!!</h3> <?php endif; ?> Standard PHP WordPress
  • 24.
  • 25. Templating The Loop The Loop is used to display posts and it also lets you control how/what to display. Basically, The Loop checks if there are posts in your blog, while there are posts, display it, if no posts found, say &quot;Not Found“ or something else.
  • 26. Templating A complete template In this example we are using some standard Template Tags to display the title of the post the_title() and we are linking it using the_permalink() . We display the_date() and the_content() . Finally for fun we call link_pages() .
  • 27. Theming <?php query_posts(&quot;showposts=8&cat=10&quot;); ?> <?php while (have_posts()) : the_post(); ?> Playing with the loop <?php query_posts(&quot;showposts=8&cat=-5,-6,-10&quot;); ?> <?php while (have_posts()) : the_post(); ?> or
  • 28. Templating Playing with the code <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?> Most blogs display categories somewhere, usually the side bar. The easiest way to do this is with the wp_list_categories() Template Tag.
  • 29. Templating Playing with the code <ul> <li id=&quot;categories&quot;> <?php wp_dropdown_categories('title_li=&hierarchical=0&show_count=1&child_of=9'); ?> <script type=&quot;text/javascript&quot;> <!-- var dropdown = document.getElementById(&quot;cat&quot;); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = &quot;<?php echo get_option('home'); ?>/?cat=&quot;+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; --> </script> </li> </ul> What if I wanted to display specific categories and have them in a dropdown box? * See the full tutorial at dropthedigibomb.com
  • 30. Templating Playing with the code <?php if(is_page(&quot;landing&quot;)) : ?> <h5 class=&quot;tagline&quot;> Hello! I'm Brendan Sera-Shriar A.K.A. <span class=&quot;blue&quot;>digibomb</span>, a freelance web designer from Montreal, Canada. </h5> <?php elseif(is_page(&quot;work&quot;) || is_page(&quot;branding&quot;) || is_page(&quot;other-projects&quot;) || is_page(&quot;client-list&quot;)) : ?> <h5 class=&quot;tagline&quot;> I don't just build <span class=&quot;blue&quot;>websites</span> I build <span class=&quot;blue&quot;>communities</span>! </h5> <?php endif; ?> What if I wanted to display different taglines on each page? * See it in action at digibombinc.com
  • 31.
  • 32. Theming Custom Post/Pages Creating your own template files is the most powerful way to gain full control over how your WordPress site looks, feels, and functions…and it’s really easy too! Creating your template: The best way to start is by modifying an existing template, like single.php or page.php.
  • 33. Theming Custom Post/Pages <?php /* Template Name: blog */ ?> <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> etc…. } This defines the template
  • 34. Theming <?php if ( is_home() ) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/home.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } elseif( is_page(&quot;blog&quot;)) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/blog.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } elseif( in_category(&quot;tutorials&quot;) ) { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('template_url'); ?>/tuts.css&quot; type=&quot;text/css“ <?php } else { ?> <link rel=&quot;stylesheet&quot; href=&quot;<?php bloginfo('stylesheet_url'); ?>&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /> <?php } ?> Alternate Stylesheets * See it in action at créer magazine
  • 35.
  • 36.
  • 37.
  • 38. Templating Very simple slider Integrating jQuery <script src=&quot;http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js&quot;></script> Load jQuery <div class=&quot;panes&quot;> <div> <?php query_posts(&quot;cat=1&quot;); ?> <?php while (have_posts()) : the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> </div> Load jQuery
  • 39. Templating Very simple slider That’s it! Integrating jQuery <script> // perform JavaScript after the document is scriptable. $(function() { // setup ul.tabs to work as tabs for each div directly under div.panes $(&quot;ul.tabs&quot;).tabs(&quot;div.panes > div&quot;); }); </script> Activate the tabs
  • 40. Templating Integrating jQuery More jQuery Examples
  • 41.
  • 42. Templating The Dashboard Custom login function my_custom_login_logo() { echo '<style type=&quot;text/css&quot;> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } </style>'; } add_action('login_head', 'my_custom_login_logo');
  • 43. Templating The Dashboard Custom logo function my_custom_logo() { echo '<style type=&quot;text/css&quot;> #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/dash_logo.png) !important; }</style>'; } add_action('admin_head', 'my_custom_logo');
  • 44. Templating The Dashboard Custom widget add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_ad_widget', 'Ads', 'custom_dashboard_ad'); } function custom_dashboard_ad() { echo '<p>Check out some other cool stuff</p><br /><img src=&quot;http://www.webdesignerwall.com/wp-content/uploads/2010/01/p2h-banner.jpg&quot; />'; }
  • 45. Extending BuddyPress is a suite of WordPress plugins and themes, each adding a distinct new feature. BuddyPress contains all the features you’d expect from WordPress but aims to let members socially interact. http://buddypress.org/ WordPress MU, or multi-user, is designed to do exactly that. It is most famously used for WordPress.com where it serves tens of millions of hits on millions of blogs each day. http://mu.wordpress.org/
  • 46. Extending When a visitor browses to a WordPress.com blog on a mobile device we show special themes designed to work on small screens focussing on fast load times. The first theme is a modification of WPtouch and is displayed to phones with rich web browsers like the iPhone and Android phones. The second theme was developed from an old version of the WordPress Mobile Edition and will be displayed to all other mobile devices.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.