Sage 9 folder structure

I’m looking at Sage 9 for the first time and I’m trying to wrap my head around the folder structure. Inside /themes/sage/ there is no style.css, functions.php, etc. These files are in resources. How does Wordpress know that!? Yet somehow it works. What’s the obvious thing I’m missing?

2 Likes

We’re not doing anything fancy. WordPress simply supports that.

I’ll have to search for Wordpress docs on that then. Which file is the entry point?

resources/functions.php

1 Like

Yeah, I think that is shown at wp-includes/class-wp-theme.php . See:

WordPress does already scan one level deep.
Also see https://github.com/roots/sage/issues/1870 . Good discussion on the way WordPress scans for files and how Roots has come up with a way to load files from more than one level deep for files in resources/views. @ben mentioned this SO thread in the solved Roots Sage issue : https://wordpress.stackexchange.com/questions/249984/page-template-in-two-level-deep-folder/250024#250024 that explains things rather well too.

1 Like