WordPress Template
In WordPress, a Template is a PHP document which controls how WordPress content is displayed.
Templates are part of WordPress Themes.
Contents
Template file names
Templates have specific file names, and each file has a specific purpose.
index.php
All Themes must include a Template file named index.php
. This is the fundamental Template for any Theme.
How Templates work
Template files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser.
Template hierarchy
All themes must include the Template file named index.php
.
Additional WordPress Templates form a hierarchy, with rules about which Template applies in a given situation.
Some Templates override other Templates. This varies according to which Templates you use, and how you use them. Commonly used Template files include:
-
single.php
-
page.php
-
category.php
See WordPress Template hierarchy
See also
External links
- Templates @ codex.wordpress.org
- Template Files @ developer.wordpress.org
- Stepping Into Templates @ codex.wordpress.org