Categories
WordPress

Custom base.php file with Roots Theme

Roots Photo

Photo Credit

I talk a lot about the Roots theme. It’s our favorite starter theme and comes with our favorite responsive framework. Roots come with its own theme wrapper which makes it a little difficult to understand for people new to WordPress.

The base.php takes the place of the usual index.php file in a WordPress theme as a theme wrapper (More on that here if you’re interested).

Occasionally you may want a custom page layout for a particular page or category. For example, a landing page where you may not have the normal header or footer shown. This is a two part process with the Roots theme:

Step 1:

Create the page template file as normal following the WordPress template hierarchy.

Examples: page-landing-page.php or page-888.php

Step 2:

Preface that file with base-

Examples: base-page-landing-page.php or base-page-888.php

2 replies on “Custom base.php file with Roots Theme”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.