Menu

Build a custom Gutenberg block in three files with 1:1 editing.
📰

Build a custom Gutenberg block in three files with 1:1 editing.

DEV Community: php·mark williams·7 days ago
#wPY3W2Oy
#devto#dev#block#callout#blocks
Long article (1400 words) — no AI summary yet.
Reading 0:00
15s threshold

Most tutorials for a custom Gutenberg block start with npx @wordpress/create-block , a React edit.js and a build step. Then they tell you to register the block in functions.php .

This one has none of that. I'm going to build a callout box, the kind you'd use for a note, a tip or a warning, with Gutenberg Control Blocks (GCB). The whole block is three small files in a folder. You don't write React, you don't run a build, and you don't register anything.

I'll say that last part again because it's the bit people don't expect: you don't register a GCB block. There's no register_block_type() call and nothing to add to functions.php . You add a folder to your theme and the block exists.

What you need

WordPress 6.8 or later and a theme you can edit.

The Gutenberg Control Blocks plugin, installed and active. It's a paid plugin for developers and agencies.

That's the whole list.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.