WordPress Template Hierarchy System

Define/Explain template hierarchy system

The WordPress Template Hierarchy is used so that you ensure the right theme is used on each of the pages at the right time. You will be able to find the right file based off the content requested.

Define/Explain template hierarchy system - order

WordPress searches the files in a specific order. It starts by searching in your theme file for the category that is created. Then if that doesn't work it then goes to to a file that uses the categories id. If that does not work it then search for a simple file name of the category such as category.php. Then if that doesn't work it goes to your archive.php template and then if that doesn't work it will end up getting your index. php file.

Define/Explain template hierarchy system - file naming conventions

Wordpress will search for the closest template file to the name it is looking for. It will find the static page that will be the first file looked for, the nit will look for the next closest thing. Then finally it will always resort to the index.php last.

Summary

WordPress template hierarchy is important to understand since this is the order that WordPress uses to search for each file. The more descriptive that your file name is makes it easier to get the right file for each page.