Template Files Section
We introduced template files earlier in the handbook. This next section is going to break up the different template files through the post types that they display and provide a more in depth explanation of the purpose for these template files. You’ll also get a handle on some practical use cases for the different template files.
You’ll start with post template files that deal with displaying the Post post type. Then you’ll look at page template files that display the Page post type and drill down into specific page templates that WordPress has built in to its functionality. Next you’ll learn about attachment template files which display the attachment post type. You’ll also learn about how to display custom post types that are built by a plugin in the custom post type templates. Lastly, you’ll touch on some partial and miscellaneous template files which are important to include but don’t necessarily display post types.
Note: It’s important to understand WordPress doesn’t really break down template files down into specific types of template files such as post template files or attachment template files. Especially since many template files, such as index.php
or search.php
can display many different post types. To help you reference specific template files this handbook is categorizing them based on the post types they can display.