Week Eight (MGDP2060)

From Wiki @ Karl Jones dot com
Revision as of 19:00, 11 October 2016 by Karl Jones (Talk | contribs) (Header and Footer Templates)

Jump to: navigation, search

This article lists topics for Week Eight of Web Design and Development III (MGDP2060).

WordPress Page Templates

Note that WordPress Page Templates do not work with WordPress Pages which are serving as Static Pages.

Static Pages are used to display a WordPress Page on the Home Page, or to display blog posts on a non-Home Page. See WordPress Home Page for more information.

WordPress Templates

A WordPress 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.

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 for more information.

Header and Footer Templates

Most WordPress Themes include Templates named header.php and footer.php, which are included in all of the other Template files.

header.php contains the top part of a web page:

footer.php contains the bottom part of a web page:

  • The lower visible portion of the web page, typically containing copyright and other supporting information
  • The closing tag of the body element
  • The closing tag of the body element

Exercises

See Week Eight Exercises (MGDP2060).