Forage is a classic WordPress starter theme adapted from Vilare and informed by Roots Sage. The project background and implementation decisions are covered in more detail on my blog.
- Blade templating
- Vite asset compilation, bundling, and hot module replacement
- Biome CSS and JavaScript linting and formatting
- Modern CSS and JavaScript with no frontend runtime framework or preprocessor
- DocHooks for registering class methods with the WordPress hooks API
- CSS-driven generation of native WordPress
theme.jsonpresets - Built-in WordPress output cleanup and performance-oriented asset loading
- IndieWeb, Microformats2, and Schema.org support
Note
Forage is in active development and may introduce changes that require attention when updating.
- WordPress >= 6.8
- PHP 8.4.27+ within PHP 8.4, or 8.5.12+ within PHP 8.5, with the DOM extension
- Composer
- Node.js 24.22.1+ within the 24.x LTS branch (
^24.22.1)
If PHP OPcache is enabled, opcache.save_comments must also be enabled because Forage uses DocBlock annotations to register WordPress hooks.
Use the latest patched release in either supported PHP branch. Composer resolves dependencies against PHP 8.4.27 to preserve that minimum; this platform setting does not upgrade the installed PHP runtime. Run composer check-platform-reqs --lock against the deployment runtime to check its actual compatibility. WordPress's Requires PHP header records the lowest supported version; Composer enforces the branch-specific requirements.
Both .nvmrc and mise.toml select Node 24.22.1. Use nvm on macOS/Linux or mise on Windows, macOS, or Linux:
- nvm: run
nvm install,nvm use, thennpm ci. - mise: run
mise trust,mise install, thenmise exec -- npm ci. Prefix subsequent npm commands withmise exec --when using this workflow.
Both managers are optional. See Node version managers for setup and deployment security notes for runtime verification and PHP advisory follow-ups.
themes/your-theme-name/
├── .vite/ # Vite plugins and build tests
├── app/ # Theme PHP
├── docs/ # Detailed project documentation
├── functions.php # WordPress theme bootstrap
├── inc/ # Bootstrap support
├── index.php # WordPress template fallback
├── resources/ # Assets and Blade views
├── screenshot.png # WordPress theme screenshot
├── style.css # WordPress theme metadata
├── template-custom.php # Example custom-template registration
├── theme.json # WordPress settings with CSS design values synced at build time
└── vite.config.js # Vite configuration
Install Forage under wp-content/themes, then run these commands from the theme directory:
composer install
npm ci
npm run buildActivate Forage in WordPress after the initial build. The generated dist/manifest.json is required whenever the Vite development server is not running.
For local HMR detection, set the WordPress environment type and start Vite:
define('WP_ENVIRONMENT_TYPE', 'local');npm run devnpm run devornpm start: start Vite with hot module replacementnpm run build: sync design tokens intotheme.jsonand compile production assetsnpm run format: format CSS and JavaScript with Biome and PHP with PHPCBFnpm run lint: check CSS and JavaScript formatting and linting with Biome, and PHP with PHPCSnpm test: run build utility regression testscomposer test: run PHP regression testsnpm run check: run all tests and linters, as CI doesnpm run test:editor: compare the block editor with the published page in Firefox; see the editor docs
Built assets in dist/ are generated and not committed. A production deployment must install dependencies and build the theme:
composer install --no-dev --optimize-autoloader
npm ci
npm run buildForage intentionally stops with an npm run build message when HMR is inactive and dist/manifest.json is missing.
- Development and asset workflow
- Editor styles, design tokens, and theme.json
- Prettify and Contact Form 7
- Upgrade notes and breaking changes
Forage includes Microformats2 and Schema.org markup intended to work with the WordPress IndieWeb ecosystem. Common companion plugins include:
- IndieWeb
- Webmention
- Syndication Links
- IndieAuth
- Post Kinds
- Micropub
IndieBlocks is another Gutenberg-oriented option that overlaps with several of these plugins.
The starter h-card displays a real author avatar when available and otherwise uses a local inline SVG instead of requesting Gravatar's generic image. Gravatar availability is checked in the background through WP-Cron and cached. On a cache miss, the placeholder appears immediately; later page requests can show the avatar after the scheduled check completes. Sites that disable automatic WP-Cron must run scheduled events through their own cron runner.
Comment avatars continue through WordPress's get_avatar() API so avatar and Webmention plugins can manage them.
When the IndieWeb plugin is active and a site has multiple users, select the appropriate Default Author under the IndieWeb settings. The h-card uses the current post author on singular content and the configured default elsewhere.
Forage keeps the classic WordPress template model and the parts of the Sage and Vilare architecture that remain useful without adopting their larger framework layers. It provides Blade templates, modern asset tooling, and selective WordPress editor integration while staying suitable as a relatively blank project starting point.
Contributions are welcome from everyone.
Forage is licensed under the GNU General Public License, version 3.
