An opinionated WordPress theme boilerplate using best practices. Designed to get things done quickly ✅
- Cache-busting content hashing for JS & CSS
- Script Deferring
- ES6 JavaScript using Babel
- Browsersync dev server
- Webpack
- Tailwind CSS
- CSS Autoprefixer
- PurgeCSS
- PostCSS Nesting
- Automatic inclusion of header.php & footer.php in each template
- Image, background-image & iframe lazy-loading with bLazy
Clone the repository into your theme directory (usually /wp-content/themes/) with a name of your choice
git clone https://github.com/sammckay10/sensible-wordpress-theme-boilerplate desired-name-for-your-new-theme
Install dependencies with Yarn or NPM (in new theme folder)
yarn || npm install
Copy .env.example to .env & change DEV_URL to the correct address for your development site
DEV_URL=http://example.com
Run the appropriate script (in new theme folder)
yarn start // for development server
yarn build // for production build