Difference between revisions of "WordPress Template"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
m (Karl Jones moved page WordPress template to WordPress Template)
Line 1: Line 1:
In [[WordPress]], a '''template''' is a [[PHP]] document which controls how [[WordPress content]] is displayed.
+
In [[WordPress]], a '''Template''' is a [[PHP]] document which controls how [[WordPress content]] is displayed.
  
Templates are part of [[WordPress theme|WordPress themes]].
+
Templates are part of [[WordPress Theme|WordPress Themes]].
  
 
== Template file names ==
 
== Template file names ==
Line 9: Line 9:
 
=== index.php ===
 
=== index.php ===
  
All themes must include a template file named <code>index.php</code>.  This is the fundamental template for any theme.
+
All Themes must include a Template file named <code>index.php</code>.  This is the fundamental Template for any Theme.
  
== How template work ==
+
== 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 template file named <code>index.php</code>.
+
All themes must include the Template file named <code>index.php</code>.
  
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.
  
See [[WordPress template hierarchy]]
+
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 template hierarchy]]
+
* [[WordPress Template hierarchy]]
* [[WordPress theme]]
+
* [[WordPress Theme]]
  
 
== External links ==
 
== External links ==

Revision as of 22: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.

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