Templates

Welcome to the Templates documentation. In this chapter you will learn how the WordPress block template system works, how to build custom templates and parts, and include them in your theme.

Templates are one of the core concepts of building websites, representing the underlying structure that presents your content in the browser. In many ways, they are the most important feature of developing WordPress themes.

Navigating this chapter

Use the below links to find the topic you are looking for in this chapter. Each section of the chapter is set up to offer a straightforward learning path toward learning how to build templates for those building their first theme. But if you are already familiar with the foundational concepts, feel free to skip ahead to the topic you want to learn more about.

  • Introduction to Templates: An overview of what templating is, how the templating system in WordPress works, and a look at the relationship between the template hierarchy, templates, and template parts.
  • Templates: How to build custom templates and include them in your WordPress theme.
  • Template Hierarchy: How WordPress decides which template to use based on the page the user is viewing.
  • Template Parts: How to build template parts and insert them into top-level templates.