Your SlideShare is downloading. ×
0
improving
   theme
development
  JASON DAVID PELKER
  ITEM-9.COM @JPELKER
THEME STANDARDS
 THEME STANDARDS
  THEME STANDARDS
THEME STANDARDS
THEME STANDARDS
    THEME
From where has
WordPress come?
What about
 themes?
What grinds
 my gears?
What grinds
 my gears?
#1
   LIMITED
MODULARIZATION
“Have you ever wanted to
change a class in the loop?
You’re likely going to have
   to edit upwards of five
files. The wor...
“Separate Theme
 Structure from
Theme Content!”
get_template_part
$slug: (required) The slug
name for the generic template.

$name: (optional) The name of
the specialized template.
Show me...
loop.php
Show me...
loop-author.php
Show me...
loop-cat.php
TwentyTen
•   In archive.php: get_template_part('loop','archive');

•   In author.php: get_template_part('loop','author');...
What’s the
   problem with
get_template_part?
The burden is on
     the user to
   implement the
template hierarchy.
No naming
conventions.

  loop-cat vs.
loop-category?
Daryl Koopersmith
“Separate the
 F*cking Theme
 Structure from
Theme Content!”
get_template_module
TwentyTen
get_template_module
 loads the first match
<?php get_template_module('loop');?>
In the
 folder
“loop”...
loop/category-news.php →
 loop/category-4.php →
  loop/category.php →
   loop/archive.php →
     loop/index.php
more reading

http://drylk.com/2010/04/06/modular-themes-organization/

                         or
        http://bit.ly/...
What grinds
 my gears?
#2
POOR NAMING
CONVENTIONS
BuddyPress
theSevenFive
By default BuddyPress templates
    use this HTML structure:
BuddyPress Template Pack
BuddyPress vs. TwentyTen
BuddyPress   TwentyTen
Before
After
3 DIVs
•container
• content
• sidebar
No div id=“container”
3 DIVs
•container
• content
• sidebar
HTML 5
Global Tags
•   header
•   section
•   article
•   nav
•   footer
CSS 3

  Multiple
Backgrounds
What grinds
 my gears?
#3
  REPETITIVE
THEME OPTIONS
“Originally themes were
   designs. Then they
 became designs with
  functions stuck on.”
               Alex Denning,
   ...
Already Built-in
•   header image
•   Woo navigation
•   custom background
Other ideas

•   post thumbnails
•   custom post types
What else?
•   PageNavi
•   breadcrumbs
•   advanced SEO
•   analytics
•   favicon
•   FeedBurner
•   date formatting
•   Twitter
•   author box
•   timthumb
•   featured slider
•   common layouts
Can a brotha
export some
  options?
Prevent
unwieldiness?
Collections
Core Plugins
•   importer/exporter
•   navigation
“Sure, there are some
 limitations with this
   system. With a set
standard, new plugins
 will likely emerge to
    fill i...
THEME
CREATIVITY
   IS...
CONTENT
+ DESIGN
THEME
EFFICIENCY
    IS...
MODULARIZATION
         +
NAMING CONVENTIONS
         +
 STANDARD OPTIONS
THEME STANDARDS
 THEME STANDARDS
  THEME STANDARDS
THEME STANDARDS
THEME STANDARDS
    THEME
improving
   theme
development
  JASON DAVID PELKER
  ITEM-9.COM @JPELKER
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Improving WordPress Theme Development through Standardization
Upcoming SlideShare
Loading in...5
×

Improving WordPress Theme Development through Standardization

2,749

Published on

“Have you ever wanted to change a class in the loop? You’re likely going to have to edit upwards of five files. The worst part? Most of the code you’re editing is identical.”

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,749
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
53
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide














  • What does Daryl suggest to do? &amp;#x201C;Separate Theme Structure from Theme Content!&amp;#x201D;


  • Here&amp;#x2019;s a loop

















  • Here&amp;#x2019;s Twenty Ten with the modules stripped out; header, content, footer.



  • If were in the news category archive page...












  • But, it&amp;#x2019;s not perfect...











  • Alex Denning



  • war of attrition

  • Other examples of WordPress sniped code?

  • More Fields, Flutter, Pods








  • More Fields, Flutter, Pods








  • Transcript of "Improving WordPress Theme Development through Standardization"

    1. 1. improving theme development JASON DAVID PELKER ITEM-9.COM @JPELKER
    2. 2. THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME
    3. 3. From where has WordPress come?
    4. 4. What about themes?
    5. 5. What grinds my gears?
    6. 6. What grinds my gears?
    7. 7. #1 LIMITED MODULARIZATION
    8. 8. “Have you ever wanted to change a class in the loop? You’re likely going to have to edit upwards of five files. The worst part? Most of the code you’re editing is identical.” Daryl Koopersmith
    9. 9. “Separate Theme Structure from Theme Content!”
    10. 10. get_template_part
    11. 11. $slug: (required) The slug name for the generic template. $name: (optional) The name of the specialized template.
    12. 12. Show me...
    13. 13. loop.php
    14. 14. Show me...
    15. 15. loop-author.php
    16. 16. Show me...
    17. 17. loop-cat.php
    18. 18. TwentyTen • In archive.php: get_template_part('loop','archive'); • In author.php: get_template_part('loop','author'); • In category.php: get_template_part('loop','category'); • In index.php: get_template_part('loop','index'); • In search.php: get_template_part('loop','search'); • In tag.php: get_template_part('loop','tag');
    19. 19. What’s the problem with get_template_part?
    20. 20. The burden is on the user to implement the template hierarchy.
    21. 21. No naming conventions. loop-cat vs. loop-category?
    22. 22. Daryl Koopersmith
    23. 23. “Separate the F*cking Theme Structure from Theme Content!”
    24. 24. get_template_module
    25. 25. TwentyTen
    26. 26. get_template_module loads the first match
    27. 27. <?php get_template_module('loop');?>
    28. 28. In the folder “loop”...
    29. 29. loop/category-news.php → loop/category-4.php → loop/category.php → loop/archive.php → loop/index.php
    30. 30. more reading http://drylk.com/2010/04/06/modular-themes-organization/ or http://bit.ly/czxWT3
    31. 31. What grinds my gears?
    32. 32. #2 POOR NAMING CONVENTIONS
    33. 33. BuddyPress
    34. 34. theSevenFive
    35. 35. By default BuddyPress templates use this HTML structure:
    36. 36. BuddyPress Template Pack
    37. 37. BuddyPress vs. TwentyTen
    38. 38. BuddyPress TwentyTen
    39. 39. Before
    40. 40. After
    41. 41. 3 DIVs •container • content • sidebar
    42. 42. No div id=“container”
    43. 43. 3 DIVs •container • content • sidebar
    44. 44. HTML 5
    45. 45. Global Tags • header • section • article • nav • footer
    46. 46. CSS 3 Multiple Backgrounds
    47. 47. What grinds my gears?
    48. 48. #3 REPETITIVE THEME OPTIONS
    49. 49. “Originally themes were designs. Then they became designs with functions stuck on.” Alex Denning, WPShout
    50. 50. Already Built-in • header image • Woo navigation • custom background
    51. 51. Other ideas • post thumbnails • custom post types
    52. 52. What else?
    53. 53. • PageNavi • breadcrumbs • advanced SEO • analytics • favicon • FeedBurner
    54. 54. • date formatting • Twitter • author box • timthumb • featured slider • common layouts
    55. 55. Can a brotha export some options?
    56. 56. Prevent unwieldiness?
    57. 57. Collections
    58. 58. Core Plugins • importer/exporter • navigation
    59. 59. “Sure, there are some limitations with this system. With a set standard, new plugins will likely emerge to fill in the gaps.” Justin Tadlock
    60. 60. THEME CREATIVITY IS...
    61. 61. CONTENT + DESIGN
    62. 62. THEME EFFICIENCY IS...
    63. 63. MODULARIZATION + NAMING CONVENTIONS + STANDARD OPTIONS
    64. 64. THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME STANDARDS THEME
    65. 65. improving theme development JASON DAVID PELKER ITEM-9.COM @JPELKER
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×