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 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.
public directory contains the compiled assets for your theme. This directory will never be manually modified.
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.
vendor directory contains your Composer dependencies and autoloader. This directory is automatically generated and should not be modified.
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