Improving WordPress Theme Development through Standardization

  • 2,640 views
Uploaded 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.”

“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.”

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,640
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
52
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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








Transcript

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