Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
WordPress Theme Development

WordPress Template Hierarchy

Learn how WordPress chooses which template file to load for each request.

WordPress Template Hierarchy — a practical guide to WordPress template hierarchy with clear examples you can reuse in real projects.

WordPress Theme Development Series (11/96). Prefer one article? Read the complete WordPress theme development tutorial.

Short description

More specific templates win (e.g. `single-book.php` before `single.php` before `index.php`). Mastering hierarchy is core theme skill.

Examples

Single post: single-$posttype-$slug.php → single-$posttype.php → single.php → singular.php → index.php
Page: page-$slug.php → page-$id.php → page.php → singular.php → index.php

Leave a reply

Your email address will not be published. Required fields are marked *