Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.
WordPress Theme Templates in Sage
View as Markdown:
The resources/views/ directory contains files that you can further extend with the normal WordPress Template Hierarchy:
404.blade.php– Error 404 pageindex.blade.php– Archive page (used by blog page, category archives, author archives and more)page.blade.php– Single pagesearch.blade.php– Search results pagesingle.blade.php– Single post pagetemplate-custom.blade.php– An example single page template
All templates are wrapped by a base file in the layouts/ directory:
app.blade.php– The base template which wraps the base markup around all template files
Note
The app layout contains all the content generated by Blade templates, but is itself wrapped by the index.php in the root of the theme.
These files include templates from the resources/views/partials/ directory which is where you'll be making most of your customizations:
comments.blade.php– Markup for commentscontent-page.blade.php– Markup included fromresources/views/page.blade.phpcontent-search.blade.php– Markup included fromresources/views/search.blade.phpcontent-single.blade.php– Markup included fromresources/views/single.blade.phpcontent.blade.php– Markup included fromresources/views/index.blade.phpentry-meta.blade.php– Post entry meta information included fromresources/views/content-single.blade.phpfooter.blade.php– Footer markup included fromresources/views/app.blade.phpheader.blade.php– Header markup included fromresources/views/app.blade.phppage-header.blade.php– Page title markup included from most of the files in theresources/views/directorysidebar.blade.php– Sidebar markup included fromresources/views/app.blade.php
Extending templates
The normal WordPress Template Hierarchy is still intact. Here’s some examples:
- Copy
index.blade.phptoauthor.blade.phpfor customizing author archives - Copy
index.blade.phptohome.blade.phpfor customizing the Home page if you’re showing the latest posts (under Reading Settings) instead of a static front page - Copy
index.blade.phptoarchive-gallery.blade.phpfor customizing the archive page for a custom post type registered asgallery - Copy
page.blade.phptofront-page.blade.phpfor customizing the static front page - Copy
page.blade.phptopage-about.blade.phpfor customizing a page called About
Last updated