Difference between revisions of "WordPress Template"
Karl Jones (Talk | contribs) m (Karl Jones moved page WordPress template to WordPress Template) |
Karl Jones (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | In [[WordPress]], a ''' | + | In [[WordPress]], a '''Template''' is a [[PHP]] document which controls how [[WordPress content]] is displayed. |
− | Templates are part of [[WordPress | + | Templates are part of [[WordPress Theme|WordPress Themes]]. |
== Template file names == | == Template file names == | ||
Line 9: | Line 9: | ||
=== index.php === | === index.php === | ||
− | All | + | All Themes must include a Template file named <code>index.php</code>. This is the fundamental Template for any Theme. |
− | == How | + | == How Templates work == |
− | Template files draw information from your [[WordPress database|WordPress MySQL database]] and generate the [[HTML]] code which is sent to the web browser. | + | Template files draw information from your [[WordPress database|WordPress MySQL database]] and generate the [[HTML]] code which is sent to the [[web browser]]. |
== Template hierarchy == | == Template hierarchy == | ||
− | All themes must include the | + | All themes must include the Template file named <code>index.php</code>. |
− | Additional WordPress | + | Additional WordPress Templates form a hierarchy, with rules about which Template applies in a given situation. |
− | Some | + | Some Templates override other Templates. This varies according to which Templates you use, and how you use them. |
− | See [[WordPress | + | See [[WordPress Template hierarchy]] |
See [https://developer.wordpress.org/themes/basics/template-hierarchy/ Template hierarchy] @ codex.wordpress.org. | See [https://developer.wordpress.org/themes/basics/template-hierarchy/ Template hierarchy] @ codex.wordpress.org. | ||
Line 31: | Line 31: | ||
* [[WordPress]] | * [[WordPress]] | ||
* [[WordPress content]] | * [[WordPress content]] | ||
− | * [[WordPress | + | * [[WordPress Template hierarchy]] |
− | * [[WordPress | + | * [[WordPress Theme]] |
== External links == | == External links == |
Revision as of 21:32, 5 September 2016
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.
See WordPress Template hierarchy
See Template hierarchy @ codex.wordpress.org.
See also
External links
- Templates @ codex.wordpress.org
- Template Files @ developer.wordpress.org
- Stepping Into Templates @ codex.wordpress.org