Skip to content

Sage Docs

Theme Structure

Introduction

The default Sage structure is intended to provide a sane starting point for both small and large WordPress sites alike.

Where a file or class is located is ultimately decided by you. As long as Composer can autoload the class or you have modified the necessary paths in your configuration, things should work as expected.

The root directory

The app/ directory

The majority of your theme functionality lives in the app directory. By default, this directory is namespaced under App and is automatically loaded by Composer using the PSR-4 autoloading standard. See our blog post on Namespacing and Autoloading if you aren't familiar with these methods.

This directory is covered more in Functionality.

The public/ directory

The public directory contains the compiled assets for your theme. This directory will never be manually modified.

The node_modules/ directory

The node_modules directory contains your Node dependencies used to build your assets during development or for production. This folder is automatically generated and should not be modified.

Don’t upload node_modules

Under no circumstances should there ever be a need to upload this folder or any of its contents to a live production server. It is a security risk.

The resources/ directory

The resources directory contains your Blade views as well as the un-compiled assets of your theme such as CSS, JavaScript, images, and fonts.

The vendor/ directory

The vendor directory contains your Composer dependencies and autoloader. This directory is automatically generated and should not be modified.

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