Composer-managed WordPress project with custom application code, Timber templates, and a safe content directory outside WordPress core.
composer install
pnpm installCopy env file and adjust values:
cp .env.example .envBuild frontend assets:
pnpm buildpublic/wordpress/— WordPress core installed by Composer. Do not put custom code here.public/content/— themes, MU plugins, plugins, uploads. This survives WordPress core reinstalls.public/content/themes/starter/— starter theme that bootsApp\StarterSite.public/content/mu-plugins/app.php— forces WordPress to use the starter theme.bootstrap/app.php— Composer autoload, service container, and config helper.bootstrap/wordpress.php— WordPress constants and project bootstrap.app/— application classes and service providers.templates/— Timber templates.routes/web.php— Timber template routing.
This project uses performing/twig-components with custom tag syntax.
- Components live in
templates/_components/ - Use them as
<x-name>/<x-folder.name> - Configuration lives in
App\StarterSite::add_to_twig()
Example:
<x-button class="button">Click me</x-button>WordPress core is installed to public/wordpress, while Composer-installed WordPress plugins/themes are installed to public/content.
This prevents custom themes and MU plugins from being deleted when WordPress core is reinstalled.