WordPress Sage Theme Framework Documentation Translation - Theme Template Structure and Extension Methods
Sage's theme templates are built on HTML5 Boilerplate and support ARIA roles and hNews microdata format. The theme contains files that can be extended like a normal WordPress template structure. The theme's main template files are listed below.
404.php- 404 Error Page
base.php- All template files are extended on this file.
index.php- Archive pages (blog pages, category archives, author archives and other archive pages)
page.php- single page
single.php- Single article page
template-custom.php- Example of a customized page template
followingtemplates/The content template file contained in the is where most of our customizations are made.
comments.php- Commentary module
content-page.phppage.phpHowever, the content template included in the single page
content-single.php- Content templates included in a single post page
single.php
content.phpindex.phpContent templates included in the home page.
entry-meta.phpcontent-single.phpThe metadata template contained in the
footer.phpbase.phpThe footer template included in the
head.php-
base.phpThe HTML contained in the
header.phpbase.phpThe top-of-page template included in the
page-header.php- The header template included in the page.
searchform.php- Search box template
sidebar.phpbase.phpThe sidebar template included in the
Extended Sage Theme Templates
Even though the Sage theme uses its own method of wrapping the theme, normal WordPress template inheritance can still be used, for example:
- make a copy of
index.phpbecause ofauthor.php, you can then create a new author archive page. - make a copy of
index.phpbecause ofhome.phpThen you can create a customized home page, provided you don't have a static home page set up inside the reading settings. - make a copy of
index.phpbecause ofarchive-gallery.phpcan then be used forgalleryThe article type creates a new archive page. - make a copy of
page.phpbecause offront-page.phpThen you can create a new custom static home page. - make a copy of
page.phpbecause ofpage-about.phpIt is then possible to create a new custom page template for the page with the alias about.
The theme wrapper documentation describes in more detail how to create a new base.phpfile, but if you need to customize it based on an existing theme base.php, copy base.php as base-.phpThat's all it takes. Alternatively, you can also add a new file to thebase.phpThe customization of base.php is achieved by using conditional functions in the