A modern WordPress theme development starter pack with Webpack, SCSS, Bootstrap, and advanced development tooling.
- 🎯 Modern JavaScript with Webpack bundling
- 💅 SCSS preprocessing with modern CSS features
- 🥾 Bootstrap 5 integration
- 🧰 Advanced Custom Fields (ACF) support with pre-configured field groups
- 🔧 Comprehensive development tooling
- 📱 Responsive design ready
- 🎨 Code formatting with Prettier
- 🔍 ESLint and Stylelint integration
- 🌐 Multilingual ready with .pot file
- 🎯 Flexible content blocks system
- 🔄 WP-Env support for local development
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm (v9 or higher)
- WordPress (v6.4 or higher)
- Advanced Custom Fields PRO plugin
- Composer for PHP dependencies
-
Clone this theme into your WordPress themes directory:
cd wp-content/themes git clone https://github.com/your-username/wptsp.git cd wptsp
-
Install dependencies:
composer install npm install
-
Set up local development environment:
npm run wp-env start
-
Start development:
npm run dev
-
For production build:
npm run build
npm run dev
- Start development with Webpack and Gulp watchnpm run build
- Create production-ready assets with Webpack and Gulpnpm run format
- Format code using WordPress scriptsnpm run lint:js
- Lint JavaScript filesnpm run lint:js:fix
- Fix JavaScript linting issues automaticallynpm run lint:css
- Lint style filesnpm run lint:css:fix
- Fix style linting issues automaticallynpm run zip
- Create a ZIP archive of the themenpm run version
- Update version, generate changelog, and commit changesnpm run packages-update
- Update WordPress packagesnpm run generate-pot
- Generate translation template file
wptsp/
├── assets/ # Theme assets
│ ├── css/ # Compiled CSS files (auto-generated)
│ ├── fonts/ # Custom web fonts
│ ├── images/ # Theme images and icons
│ │ └── icons/ # SVG icons and small graphics
│ ├── js/
│ │ └── src/ # JavaScript source files
│ └── scss/ # SCSS source files (7-1 pattern)
│ ├── blocks/ # Block-specific styles
│ ├── components/ # Reusable component styles
│ ├── _variables.scss # Global variables
│ ├── _mixins.scss # Custom mixins
│ ├── editor.scss # Gutenberg editor styles
│ └── main.scss # Main stylesheet
├── build/ # Production build files
├── config/ # Build configuration
│ └── webpack.config.js # Webpack configuration
├── inc/ # PHP includes
│ ├── acf-field-groups.json # ACF field configurations
│ ├── acf.php # ACF setup and functions
│ ├── blocks.php # Block registration and rendering
│ ├── cpts.php # Custom Post Types
│ └── template-functions.php # Theme functions
├── languages/ # Internationalization
├── template-parts/ # Template partials
│ ├── content/ # Post type templates
│ ├── flexible/ # ACF flexible content blocks
│ ├── header-options.php
│ └── footer-options.php
├── composer.json # PHP dependencies
├── functions.php # Theme functions and setup
├── gulpfile.js # Build automation tasks
├── package.json # Node.js dependencies
├── style.css # Theme metadata
├── theme.json # Theme settings and configuration
└── wp-env.json # Local development environment
Note: The css/
directory and build files are auto-generated. Never edit them directly; modify the source files in scss/
and js/src/
instead.
-
SCSS files are organized in the
assets/scss/
directory:- Component styles in
components/
- Block styles in
blocks/
- Global styles and variables in root directory
- Component styles in
-
JavaScript files are in
assets/js/src/
:- Entry point is
main.js
- Uses ES6+ features (transpiled by Babel)
- Entry point is
-
Template structure:
- Block templates in
template-parts/flexible/
- Content templates in
template-parts/content/
- Header/footer options in
template-parts/
- Block templates in
- JavaScript follows ESLint rules with WordPress coding standards
- SCSS follows Stylelint rules with standard SCSS config
- PHP follows WordPress coding standards
- All code is formatted using Prettier
The theme includes pre-built ACF blocks:
- Hero section
- Cards grid
- CTA (Call to Action)
- Text block
- Video embed
To create new blocks, add templates to template-parts/flexible/
and register them in inc/blocks.php
.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.