ralfhortt / wordpress-theme-boilerplate
A WordPress Boilerplate Theme by Ralf Hortt
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 5
Open Issues: 1
Language:JavaScript
Type:wordpress-theme
Requires
- laravel/pint: ^1.22
- ralfhortt/wp-assets: *
- ralfhortt/wp-image-sizes: ^1.0
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2
- rector/rector: ^2.0
- szepeviktor/phpstan-wordpress: ^2.0
This package is auto-updated.
Last update: 2025-06-04 20:59:52 UTC
README
Documentation
Every folder contains a README.md
with further instructions
Installation
$ composer create-project ralfhortt/wordpress-theme-boilerplate
Check INSTALLATION.md
for detailed installation steps
Development
Commands
npm run make:block
– Interactive prompt to create a new block insrc/theme/blocks/<block-name>
. Generatesblock.json
,edit.tsx
,index.tsx
, andsave.tsx
from stubs.npm run make:style
– Interactive prompt to create a new block style JSON insrc/theme/blocks/<block-name>
.npm run make:block-config
– Interactive prompt to create a new block configuration JSON insrc/theme/blocks/<block-name>
.npm run build:theme
– Builds thetheme.json
file fromsrc/theme/
and copies block style JSON files to thestyles
folder.
Hot Module Reloading
For a fast development workflow, hot module reloading (HMR) is enabled via wp-scripts
:
- Run
npm run start
This starts the development server with HMR for JS, TS, and SCSS files. Changes are automatically reflected in the browser without a full reload.
Linters
- PHP:
- Lint:
npm run lint:php
(runs PHPStan) - Format:
npm run lint:php:fix
(runs Pint)
- Lint:
- JavaScript/TypeScript:
- Lint:
npm run lint:js
(if configured) - Format:
npm run lint:js:fix
(if configured)
- Lint:
- CSS/SCSS:
- Lint:
npm run lint:css
- Format:
npm run lint:css:fix
- Lint:
You can also run all linters with npm run lint
(if configured).
Fixers
- PHP:
- Format code using Laravel Pint:
composer run format
- Format code using Laravel Pint:
- CSS/SCSS:
- Auto-fix with Stylelint:
npm run lint:css:fix
- Auto-fix with Stylelint:
- JavaScript/TypeScript:
- Auto-fix with ESLint (if configured):
npm run lint:js:fix
- Auto-fix with ESLint (if configured):
Code Formatting
Use Laravel Pint to automatically format PHP code:
composer run format
You can customize Pint's rules by adding a pint.json
or pint.json5
configuration file to your project root.
Code Upgrades
Run Rector to automatically upgrade and refactor PHP code:
composer run rector
See Rector documentation for configuration and usage details.