Difference between revisions of "WordPress Template"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Template hierarchy)
(Template hierarchy)
Line 21: Line 21:
 
Additional WordPress Templates form a hierarchy, with rules about which Template applies in a given situation.
 
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.
+
Some Templates override other Templates.  This varies according to which Templates you use, and how you use them. Commonly used Template files include:
 +
 
 +
* <code>single.php</code>
 +
* <code>page.php</code>
 +
* <code>category.php</code>
  
 
See [[WordPress Template hierarchy]]
 
See [[WordPress Template hierarchy]]

Revision as of 07:15, 5 October 2016

In WordPress, a Template is a PHP document which controls how WordPress content is displayed.

Templates are part of WordPress Themes.

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