This boilerplate provides a structured project template for creating a Hybrid WordPress Theme, which combines traditional classic theme features with the block-based capabilities introduced by the WordPress Block Editor (Gutenberg). Leveraging @wordpress/env, webpack, and PostCSS, this boilerplate adheres to WordPress best practices by separating data and business logic (plugin) from presentation and styling (theme).
Learn more about Hybrid Themes here.
Follow these steps to set up your project and start coding:
- Use as Repository Template: Create a new repository from this template to avoid manually setting up the structure.
- Project Slug: Choose a unique slug that won’t conflict with other repositories or projects.
-
Replace Project Slug:
- Search and replace (case-sensitive):
lhpbp
with your new project-specific slug.LHPBP
with the uppercase version of your slug.
- Search and replace (case-sensitive):
-
Update Details:
- Modify project information in
package.json
. - Update file headers in
theme/style.css
andplugin/lhpbpp.php
.
- Modify project information in
-
Rename Plugin File:
- Rename the main plugin file from
plugin/lhpbpp.php
toplugin/<your_project_slug>p.php
.
- Rename the main plugin file from
-
Start the Environment:
- Run
npm start
to spin up the Docker environment.
- Run
-
Access WordPress Admin:
- Open
http://localhost/wp-admin
in your browser. - Use the credentials
admin
(username) andpassword
(password) to log in.
- Open
-
Set up GitHub Secrets:
- Add
GH_ADMIN_TOKEN
to GitHub Action secrets and Dependabot secrets.
- Add
-
Create a Test Release:
- Trigger a patch release via the GitHub release action.
-
Verify Release:
- Check the releases section on GitHub to confirm the release was created and uploaded.
-
Customize Documentation:
- Edit
project-README.md
with your specific project details.
- Edit
-
Organize README Files:
- Delete or rename this
README.md
(current file). - Rename
project-README.md
toREADME.md
.
- Delete or rename this
-
Celebrate 🎉
Hybrid WordPress Themes represent a middle ground between traditional Classic Themes and Full Site Editing (FSE) Block Themes. They combine elements of both, allowing users to take advantage of block-based design capabilities while retaining familiar classic theme functionality. Hybrid Themes offer a balanced approach, providing flexibility without requiring a full commitment to FSE.
Benefits of Hybrid Themes:
- Balanced Editing Experience: Supports both classic and block editing modes, allowing for flexibility in design and layout.
- Enhanced Block Capabilities: Includes features like block templates, block parts, and custom configurations via
theme.json
. - Greater Design Control: Allows extensive customization for pages, posts, and archive layouts while keeping traditional editing options.
- Compatibility: Works seamlessly with both classic WordPress setups and Block Editor elements, providing the best of both worlds.
This boilerplate enables you to develop a flexible, scalable Hybrid Theme that leverages the strengths of both classic and block-based features, delivering a future-ready WordPress experience with maximal control and compatibility.