This theme combines two starter themes: FootMATE + Sage. I go into more detail on my blog post about everything.
Sage is a WordPress starter theme with a modern development workflow.
FootMATE is a modern WordPress starter theme
[!NOTE]
Forage is in active development and might add or subtract features as it matures. It will introduce some updates that might need attention from time to time.
Make sure all dependencies have been installed before moving on:
themes/your-theme-name/ # → Root of your theme
├── app/ # → Theme PHP
│ ├── Assets/ # → Loader and Resolver files
│ ├── Comments/ # → Comment_Walker
│ ├── Core/ # → Core files
│ ├── Integrations/ # → Various integrations
│ └── Templates/ # → Render and Compile Templates files
├── composer.json # → Autoloading for `vendor/` files
├── composer.lock # → Composer lock file (never edit)
├── dist/ # → Built theme assets (never edit)
├── node_modules/ # → Node.js packages (never edit)
├── package.json # → Node.js dependencies and scripts
├── vite.config.js # → Vite config file
├── yarn.lock # → Yarn lock file (never edit)
├── resources/ # → Theme assets and templates
│ ├── fonts/ # → Theme fonts
│ ├── images/ # → Theme images
│ ├── scripts/ # → Theme javascripts
│ ├── styles/ # → Theme stylesheets
│ ├── functions.php # → Composer autoloader, theme includes
│ ├── index.php # → Never manually edit
│ ├── screenshot.png # → Theme screenshot for WP admin
│ ├── style.css # → Theme meta information
│ └── views/ # → Theme templates
│ └── partials/ # → Partial templates
└── vendor/ # → Composer packages (never edit)
Multiple features of this theme require the environment type to be set.
To enable these features, add or adjust WP_ENVIRONMENT_TYPE
in wp-config.php
located in the root of your WordPress installation. The value needs to be either development
or local
.
define( 'WP_ENVIRONMENT_TYPE', 'development' );
Install Forage using Composer from the theme directory:
# @ wp-content/themes/
$ composer install
yarn
from the theme directory to install dependenciesyarn build
— Compile and optimize the files in your assets directoryyarn dev
— Compile assets when file changes are made using Vite's hot module reloadLightning CSS is a fast CSS parser that can be used as a great tool to manage the project's CSS. The primary benefit is in its speed and transpiling over PostCSS/ESBuild.
To enable Lightning CSS, run yarn add --dev lightningcss
to add Lightning CSS as a new package referenced in devDependencies
in package.json
.
In vite.config.js
, uncomment the two lines containing references to Lightning CSS and it'll be active by default.
For more info on whether or not to add this package, you can check Vite's official documentation for Lightning CSS.
This theme has many pieces that integrate with the IndieWeb ecosystem out of the box with provided IndieWeb WordPress plugins. Specifically, I recommend the following:
If you use Gutenberg, you can also try IndieBlocks, which duplicates most of the plugins above except IndieWeb Plugin and IndieAuth.
I'm highlighting a feature called h-card, which is a Microformats2 format for publishing people and a vital building block for the IndieWeb to work with WordPress.
If you haven't already installed any of the above and want to test the waters, you can start with the IndieWeb Plugin. Generally, everything should just work out of the box.
If you have more than one WordPress user on your site, to use the correct person for the h-card, go to wp-admin/admin.php?page=iw_general_options
of your WordPress instance and make sure the Default Author is correct.
While this theme purposely doesn't include any external dependencies for projects, anything can be added to the workflow. But, before you do this, a couple of things to keep in mind.
.jsx
, .tsx
, .vue
and more are provided natively in Vite. With this support, you likely don't need an additional dependency for React or Vue..scss
, .less
, .styl
and more are provided natively in Vite. The only additional thing to do is add the pre-processor itself, such as:Scss
yarn add -D sass
.css
files already. If you want to support Sass specific language features like Mixins or Functions, add postcss-scss in devDependencies
and you'll get most everything you need from the Sass language processed by PostCSS.With anything mentioned above, if you add additional dependencies to package.json
, make sure to update vite.config.js
to include the necessary watch files and syntax.
Vite's documentation provides a lot of great info to extend the Vite config file.
The Roots Sage project provided an excellent philosophy and approaches for a progressively developed WordPress theme, but after version 9, Sage had too many interconnected pieces, new dependencies, and legacy to keep up with. Additionally, having focused on so many other returning to an old version of Sage left much to be desired, as well as plenty of broken services or packages.
I found FootMATE in spring of 2024 looking for an alternative. Strangely, it follows enough of a paradigm similar to Sage that it feels like a younger cousin. Also, the author decided to integrate Vite instead of Webpack, and that's a huge win for productivity and DX.
The combination of the two themes satisfies my desire for good file architecture and modern tooling without much bloat or dependencies. It just works.
WordPress' direction towards full-site editing and Gutenberg leaves much to be desired for developers working on WordPress. This theme, while starting from a basis of the classic theme structure, has a lot of flexibility between the two worlds of classic and modern WordPress theme development.
I wrote more on the theme in a blog post on my site.
Contributions are welcome from everyone.