Unlock Hidden Power: 6 Little-Known Ways to Master Custom Block Styles in WordPress
Method 1: add a block style via a JSON file (/styles
folder)
- Best for: Theme developers
- Where you would typically use it: Commonly in themes
- Version requirements: WordPress 6.6 or higher with
theme.json
v3
For theme developers, the most streamlined way to add custom block styles to a theme is to add a new file to the /styles folder.
This method requires upgrading the theme.json
schema to v3, which is only available in WordPress 6.6 and above. As a theme developer, you would either require your users to install the Gutenberg plugin or update the minimum requirement for your theme to WordPress 6.6 to ensure everything works as intended.