WordPress uses templates in a hierarchical manner. It falls back onto other template files if you haven’t specifically defined ones in your theme. This is a great system, but sometimes, as with customised loop flow logic with hooks and filters, it can be a little difficult to maintain a complete overview in your head!
Thankfully, Chip Bennett has created an excellent flow diagram showing the WordPress template hierarchy flow. Not only this but it shows the default PHP conditionals used to select template files and the CSS classes applied. A useful resource to bookmark.
Discover more from Gavin Orland
Subscribe to get the latest posts sent to your email.
Comment: