From the course: First Look: WordPress Full-Site Editing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating custom blocks

Creating custom blocks - WordPress Tutorial

From the course: First Look: WordPress Full-Site Editing

Start my 1-month free trial

Creating custom blocks

- [Narrator] There are several approaches you can take when it comes to creating custom blocks. And that's what we're going to cover in this lesson. The first way is to manually create a block using the NPM WordPress block package. This method requires the most technical know-how and does rely on some working knowledge of JavaScript. It goes like this, HTML is used to define the block markup. CSS is used to style the block. JavaScript is used to register the block, configure it, and set up two important functions, edit and save. Now, the edit function handles what's rendered in the block editor and the save function defines how you want your block to be displayed on the front end. And it also saves that block markup to the database. Lastly, PHP comes into play by loading the scripts and styles that support the block. I know I'm covering this with a lot of simplicity, so if you really want to dig in on it, I very much I recommend…

Contents