Chip Bennett Working On New Template Hierarchy Diagram

Chip Bennett is currently in the middle of creating an updated version of the template hierarchy diagram which shows the structure of how a page is displayed. The new diagram is a bit more detailed than the old one. These diagrams are an excellent way to learn about Template Tags in WordPress as well as visually see the process for determining which page is displayed.

Old Template Diagram
New Template Diagram

Chip Bennett is looking for feedback on his version of the template diagram. You can either comment on this article with your feedback or give him a shout out on twitter via @Chip_Bennett.

8

8 responses to “Chip Bennett Working On New Template Hierarchy Diagram”

  1. Chip I think your comment system swallowed my comment (no feedback after posting it) so I’ll post it here.

    Good work Chip! This is a really nice improvement.

    There’s an error though (looking at rev 3). The is_tax() conditional isn’t true for category and tag archives as the diagram states. The “Taxonomy Archive” block should be removed, and the “Category Archive”, “Tag Archive”, and “Custom Taxonomy Archive” blocks should be moved up to the same level as “Date Archive”, “Author Archive” and “Custom Post Type Archive”.

    Also the “Custom Post Type Archive” block can have “post-type-archive post-type-archive-$posttype” added for its body classes.

    John

  2. Yup, same thing happened to me on your site Chip, no feedback on commenting. Was stating that I send people to the diagram very frequently from the forums, and VoodooPress. Your diagram is far better than the word chart I had running, which was only one step up from a cocktail napkin. Much appreciate the effort!

  3. @John Blackbourn

    There’s an error though (looking at rev 3). The is_tax() conditional isn’t true for category and tag archives as the diagram states.

    Oh, dear! Thanks for pointing that out. I inferred that from the is_tax() Codex page, which just states “Taxonomy” as opposed to custom taxonomy, and which also lists all of the core-registered taxonomies.

    (Note to self: update is_tax() Codex page to clarify.)

    The “Taxonomy Archive” block should be removed, and the “Category Archive”, “Tag Archive”, and “Custom Taxonomy Archive” blocks should be moved up to the same level as “Date Archive”, “Author Archive” and “Custom Post Type Archive”.

    Sure enough! Fixed in my working copy.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.