Styling post_terms block
-
How can I add styling to the post_terms block? I want tags to display as buttons in my child theme.
I first tried to add styling for the variation ‘post_tags’ in my theme.json, but it didn’t work.
"core/post-terms": { "variations": { "post_tags": { ... } },
AFAIK this should apply styling to tags, but it doesn’t?
I then tried to add a custom block style for the post_terms block, but it didn’t show up in the editor.
/* Register block style button-terms */ wp.blocks.registerBlockStyle('core/post-terms', { name: 'button-terms', label: wp.i18n.__('Button style terms', 'textdomain') });
In the block editor, there is no option to choose a style when I insert the block. Why? All my other block styles work as expected.
Adding the custom block style class (.is-style-button-terms) with the Advanced field where you can add classes work.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Styling post_terms block’ is closed to new replies.