Improving WordPress Theme Development through Standardization

3,047 views

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
3,047
On SlideShare
0
From Embeds
0
Number of Embeds
97
Actions
Shares
0
Downloads
64
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide














  • What does Daryl suggest to do? “Separate Theme Structure from Theme Content!”


  • Here’s a loop

















  • Here’s Twenty Ten with the modules stripped out; header, content, footer.



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












  • But, it’s not perfect...











  • Alex Denning



  • war of attrition

  • Other examples of WordPress sniped code?

  • More Fields, Flutter, Pods








  • More Fields, Flutter, Pods








  • 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

    ×