Chapter 12. Dissecting the Comment Loop, Template Tags, and Theme Best Practices


  • Using hooks in themes

  • Implementing scripts in themes

  • Using template tags to make themes dynamic

  • Creating conversations with threaded comments and paged comments

  • Personalizing the reader experience with avatars

Creating themes for WordPress is still a somewhat subjective process. Perhaps this is because designers, as a demographic, tend to be free-thinking artists rather than straight-line developers. There is no real "right" or "wrong" way to create a theme. However, there are certainly best practices and elements that are useful.

As WordPress continues to evolve, there is a lot of discussion cropping up in the WordPress community about standardizing themes and coding practices. Whether anything truly takes hold depends largely on the community's capability to demand standards and hold designers feet to the fire on them, as the community did with plugins.

Already, requires certain elements for all themes that will be hosted on The WordPress Themes Directory, located at, also enforces certain standards if designers want to have their themes hosted and gain the marketing advantages of being listed in the directory.

As the community has grown and WordPress has greater influence, the need for standardization has become forefront. Plugin developers must adhere to the WordPress application programming interface (API) standards; when they ...

Get WordPress® Bible, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.