WordPress Template

From Wiki @ Karl Jones dot com
Revision as of 07:15, 5 October 2016 by Karl Jones (Talk | contribs) (Template hierarchy)

Jump to: navigation, search

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