How to override Gutenberg admin CSS

To override Gutenberg’s styles you need to add your own stylesheet. So hook into enqueue_block_editor_assets and then add your own stylesheet in which you target the selectors you wanna override. In the following example I placed a stylesheet in a custom theme’s assets/ folder. functions.php: // Add backend styles for Gutenberg. add_action(‘enqueue_block_editor_assets’, ‘gutenberg_editor_assets’); function gutenberg_editor_assets() … Read more

Any way to get more space for editing post excerpts

Depending on the context, in which you would like to make these changes, I’d simply remove the metabox from that certain post type. Then add another metabox above the editor for your excerpt box. The downside: you can not use get_the_excerpt, the_excerpt etc. anymore because that metabox doesn’t exist any more. Have a look at … Read more

Custom taxonomy is crashing Gutenberg

Changing the taxonomy name fixes. I’ll wager the guess that having it called ‘type’ was conflicting with the Gutenberg js. $args = array( ‘labels’ => $labels, ‘hierarchical’ => false, ‘public’ => true, ‘show_ui’ => true, ‘show_admin_column’ => true, ‘show_in_nav_menus’ => true, ‘show_tagcloud’ => false, ‘show_in_rest’ => true, ); register_taxonomy( ‘resource-type’, array( ‘resource’ ), $args );

Wrap shortcode inside custom block

First Add a normal Shortcode block and type the shortcode [foo]123[/foo] Then click More Options for the block and select Add to Reusable Blocks Then provide a name as Foo Next, time you can search and add the Foo block instead of typing the shortcode Thanks

Getting RGBA colour from gutenberg colourpicker

If you mean wp.components.ColorPicker which is based on react-color, then the tint object also contains a rgb property with an object of the RGBA value like {r: 51, g: 51, b: 51, a: 1}. So in your code, you can use: style={{ backgroundColor: `rgba(${tint.rgb.r}, ${tint.rgb.g}, ${tint.rgb.b}, ${tint.rgb.a})` }} And an easy trick to know all … Read more

Do not change the order of the tags in the editor

Terms/Tags aren’t ordered. To help make the terms easier to read, the editor will list them alphabetically, but that isn’t because they’re ordered alphabetically in the database. It’s because a piece of javascript sorted the terms in the UI control. There is no order, only the order you give them. Fundamentally terms have no order. … Read more