Wordpress Template Hierarchy System
The Wordpress Template Hierarchy System (WTHS) is the system that determines what template or templates should be used to display the page. This uses a query string from a URI, that is contained in the link to each part of a site.
WTHS Order
The order of the hierarchy is dependent upon a given query. The structure is generally as follows:
Firstly, it will try to search for a file that matches the exact name of the query.
Failing that, it will try to identify a slug, id, or category.
Failing that, it will then search for a lower level page such as single.php or page.php
Finally, if none can be found, it will default to index.php as the root file.
Naming Conventions
Naming conventions for the hierarchy typically follow a sort of specificity. It will try to get as specific as possible to start, and then if it cannot find anything exact, it will then default to less specific options, such as categories or tags. It will then go for more general pages, and then ultimately default to index.php if literally nothing can be found.
Summary
In Summary, we talked about the Wordpress Template Hierarchy System. We talked about the order in which templates are prioritized based on given queries. We also talked about how the naming conventions themselves focus on the specifics of the query as it searches based on priority.