Sage’s theme templates are built on HTML5 Boilerplate and support ARIA roles and the hNews microformat. The files included with the theme can be extended much like a standard WordPress template structure. The main template files in the theme are listed below.
404.php- The 404 error page.
base.php- All template files extend from this file.
index.php- Archive pages such as the blog index, category archives, and author archives.
page.php- Single pages.
single.php- Single post pages.
template-custom.php- An example custom page template.
Below are the content template files included in templates/. Most of our custom work usually happens there.
comments.php- The comments template part.
content-page.php- The content template included by
page.php.
content-single.php- The content template included by
single.php.
content.php- The content template included by
index.php.
entry-meta.php- The metadata template included by
content-single.php.
footer.php- The footer template included by
base.php.
head.php- The HTML
<head>template included bybase.php.
header.php- The page header template included by
base.php.
page-header.php- The page title/header template used inside pages.
searchform.php- The search form template.
sidebar.php- The sidebar template included by
base.php.
Extending Sage templates
Even though Sage wraps theme files in its own way, normal WordPress template hierarchy rules still work. For example:
- Copy
index.phptoauthor.phpto create a custom author archive template. - Copy
index.phptohome.phpto create a custom blog home page, as long as you have not set a static front page in Reading Settings. - Copy
index.phptoarchive-gallery.phpto create an archive template for agallerypost type. - Copy
page.phptofront-page.phpto create a custom static front page. - Copy
page.phptopage-about.phpto create a custom page template for the page whose slug isabout.
The wrapper documentation explains in more detail how to create a new base.php file. But if you only need to customize the existing base wrapper, simply copy base.php to base-<template name>.php. You can also use conditional functions in base.php to customize it.
