How to create custom block for wordpress

Gutenberg is the latest editor for Wordpress. It uses “blocks” to edit the content of its pages and posts. These blocks can be any different kind of stuff: Text, buttons, heading, carousels, dropdowns, etc…

To create your custom blocks, go to your “plugins” folder and run this command:

npx @wordpress/create-block my-custom-block

If you do not know what npx is, we are talking about the node package manager for Node.js.

This command will create a new plugin folder with all the necessary files wired up and bootstrapped, so that you can start right away to develop your plugin. Just go to your the plugin page inside Wordpress and make sure to activate the new plugin.

If you do not know how to develop custom blocks, I recommend that you watch this great playlist from Alessandro Castellani . In these videos he will explain very well the first steps that you can take to start creating your own blocks.,d

Dec 19, 2020