Theme Templates
The resources/views/
directory contains files that you can further extend with the normal WordPress Template Hierarchy:
-
404.blade.php
– Error 404 page -
index.blade.php
– Archive page (used by blog page, category archives, author archives and more) -
page.blade.php
– Single page -
search.blade.php
– Search results page -
single.blade.php
– Single post page -
template-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 comments -
content-page.blade.php
– Markup included fromresources/views/page.blade.php
-
content-search.blade.php
– Markup included fromresources/views/search.blade.php
-
content-single.blade.php
– Markup included fromresources/views/single.blade.php
-
content.blade.php
– Markup included fromresources/views/index.blade.php
-
entry-meta.blade.php
– Post entry meta information included fromresources/views/content-single.blade.php
-
footer.blade.php
– Footer markup included fromresources/views/app.blade.php
-
header.blade.php
– Header markup included fromresources/views/app.blade.php
-
page-header.blade.php
– Page title markup included from most of the files in theresources/views/
directory -
sidebar.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.php
toauthor.blade.php
for customizing author archives - Copy
index.blade.php
tohome.blade.php
for customizing the Home page if you’re showing the latest posts (under Reading Settings) instead of a static front page - Copy
index.blade.php
toarchive-gallery.blade.php
for customizing the archive page for a custom post type registered asgallery
- Copy
page.blade.php
tofront-page.blade.php
for customizing the static front page - Copy
page.blade.php
topage-about.blade.php
for customizing a page called About
Contributors
Last updated
Support Roots
Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.
Sponsor Roots on GitHub