A WordPress starter theme with a modern development workflow, build with Sage and Tailwindcss
Make sure all dependencies have been installed before moving on:
Clone this repositry (replace your-theme-name
below with the name of your theme):
# @ wp-content/themes/
$ clone https://github.com/PILO7980/Sage-Tailwindcss.git your-theme-name
Install dependency:
# @ wp-content/themes/your-theme-name
$ yarn
Generates the tailwind.js
config file in styles directory:
# @ wp-content/themes/your-theme-name
$ ./node_modules/.bin/tailwind init resources/assets/styles/tailwind.js
or if you have npx installed globally: (tip: you do have it if you are running npm
5.2.0+):
# @ wp-content/themes/your-theme-name
$ npx tailwind init resources/assets/styles/tailwind.js
themes/your-theme-name/ # → Root of your Sage based theme
├── app/ # → Theme PHP
│ ├── controllers/ # → Controller files
│ ├── admin.php # → Theme customizer setup
│ ├── filters.php # → Theme filters
│ ├── helpers.php # → Helper functions
│ └── setup.php # → Theme setup
├── composer.json # → Autoloading for `app/` 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
├── resources/ # → Theme assets and templates
│ ├── assets/ # → Front-end assets
│ │ ├── config.json # → Settings for compiled assets
│ │ ├── build/ # → Webpack and ESLint config
│ │ ├── fonts/ # → Theme fonts
│ │ ├── images/ # → Theme images
│ │ ├── scripts/ # → Theme JS
│ │ └── 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
│ ├── layouts/ # → Base templates
│ └── partials/ # → Partial templates
└── vendor/ # → Composer packages (never edit)
Edit app/setup.php
to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
resources/assets/config.json
settings:devUrl
should reflect your local development hostnamepublicPath
should reflect your WordPress folder structure (/wp-content/themes/your-theme-name
for standards Worpress installs)yarn start
— Compile assets when file changes are made, start Browsersync sessionyarn build
— Compile and optimize the files in your assets directoryyarn build:production
— Compile assets for production