[agentsw ua=’pc’]
Do you want to create a custom Gutenberg block for your WordPress website?
While WordPress comes with a lot of basic blocks for creating content, you might need something more custom for your website.
In this article, we’ll show you an easy way to create custom Gutenberg blocks for your WordPress site.

Why Create a Custom WordPress Block?
WordPress comes with an intuitive block editor that allows you to easily create your posts and pages by adding content and layout elements as blocks.
By default, WordPress ships with several commonly used blocks. WordPress plugins may also add their own blocks that you can use.
However, sometimes you may want to create your own custom block to do something specific, and can’t find a blocks plugin that works for you.
In this tutorial, we’ll show you how to create a completely custom block.
Note: This article is for intermediate users. You’ll need to be familiar with HTML and CSS to create custom Gutenberg blocks.
Step 1: Get Started with Your First Custom Block
First, you need to install and activate the Genesis Custom Blocks plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Created by the folks behind the popular Genesis Theme Framework and StudioPress, this plugin provides developers easy tools to quickly create custom blocks for their projects.
For the sake of this tutorial, we will build a ‘testimonials’ block.
First, head over to Custom Blocks » Add New page from the left sidebar of your admin panel.

This will bring you to the Block Editor page.
From here, you need to give a name to your block.

On the right side of the page, you’ll find the block properties.
Here you can choose an icon for your block, add a category, and add keywords.

The slug will be auto-filled based on your block’s name, so you don’t have to change it. However, you may write up to 3 keywords in the Keywords text field so that your block can be easily found.
Now let’s add some fields to our block.
You can add different types of fields like text, numbers, email address, URL, color, image, checkbox, radio buttons, and much more.
We’ll add 3 fields to our custom testimonial block: an image field for the image of the reviewer, a textbox for the reviewer name, and a text area field for the testimonial text.
Click on the [+] Add Field button to insert the first field.

This will open up some options for the field. Let’s take a look at each of them.
- Field Label: You can use any name of your choice for the field label. Let’s name our first field ‘Reviewer Image’.
- Field Name: The field name will be generated automatically based on the field label. We’ll use this field name in the next step, so make sure it’s unique for every field.
- Field Type: Here you can select the type of field. We want our first field to be an image, so we’ll select Image from the dropdown menu.
- Field Location: You can decide whether you want to add the field to the editor or the inspector.
- Help Text: You can add some text to describe the field. This is not required if you’re creating this block for your personal use, but may be helpful for multi-author blogs.
You may also get some additional options based on the field type you choose. For example, if you select a text field, then you’ll get extra options like placeholder text and character limit.
Following the above process, let’s add 2 other fields for our testimonials block by clicking the [+] Add Field button.
In case you want to reorder the fields, then you can do that by dragging them using the handle on the left side of each field label.
To edit or delete a particular field, you need to click the field label and edit the options in the right column.

Once you’re done, click on the Publish button, present on the right side of the page, to save your custom Gutenberg block.
Step 2: Create a Custom Block Template
Although you’ve created the custom WordPress block in the last step, it won’t work until you create a block template.
The block template determines exactly how the information entered into the block is displayed on your website. You get to decide how it looks by using HTML and CSS, or even PHP code if you need to run functions or do other advanced things with the data.
There are two ways to create a block template. If your block output is in HTML/CSS, then you can use the built-in template editor.
On the other hand, if your block output requires some PHP to run in the background, then you’ll need to manually create a block template file and upload it to your theme folder.
Method 1. Using Built-in Template Editor
On the custom block edit screen simply switch to the Template Editor tab and enter your HTML under the markup tab.

You can write your HTML and use double curly brackets to insert block field values.
For instance, we used the following HTML for the sample block we created above.
<div class="testimonial-item">
<img src="{{reviewer-image}}" class="reviewer-image">
<h4 class="reviewer-name">{{reviewer-name}}</h4>
<div class="testimonial-text">{{testimonial-text}}</div>
</div>
After that, switch to the CSS tab to style your block output markup.

Here is the sample CSS we used for our custom block.
.reviewer-name {
font-size:14px;
font-weight:bold;
text-transform:uppercase;
}
.reviewer-image {
float: left;
padding: 0px;
border: 5px solid #eee;
max-width: 100px;
max-height: 100px;
border-radius: 50%;
margin: 10px;
}
.testimonial-text {
font-size:14px;
}
.testimonial-item {
margin:10px;
border-bottom:1px solid #eee;
padding:10px;
}
Method 2. Manually Uploading Custom Block Templates
This method is recommended if you need to use PHP to interact with your custom block fields.
You’ll basically need to upload the editor template directly to your theme.
First, you need to create a folder on your computer name it with your custom block name slug. For instance, our demo block is called Testimonials so we’ll create a testimonials folder.

Next, you need to create a file called block.php
using a plain text editor. This is where you’ll put the HTML / PHP part of your block template.
Here is the sample template we used for our example.
<div class="testimonial-item <?php block_field('className'); ?>">
<img class="reviewer-image" src="<?php block_field( 'reviewer-image' ); ?>" alt="<?php block_field( 'reviewer-name' ); ?>" />
<h4 class="reviewer-name"><?php block_field( 'reviewer-name' ); ?></h4>
<div class="testimonial-text"><?php block_field( 'testimonial-text' ); ?></div>
</div>
Notice how we used the block_field()
function to fetch data from a block field.
We have wrapped our block fields in the HTML we want to use to display the block. We have also added CSS classes so that we can style the block properly.
Don’t forget to save the file inside the folder you created earlier.
Next, you need to create another file using the plain text editor on your computer and save it as block.css
inside the folder you created.
We’ll use this file to add CSS needed to style our block display. Here is the sample CSS we used for this example.
.reviewer-name {
font-size:14px;
font-weight:bold;
text-transform:uppercase;
}
.reviewer-image {
float: left;
padding: 0px;
border: 5px solid #eee;
max-width: 100px;
max-height: 100px;
border-radius: 50%;
margin: 10px;
}
.testimonial-text {
font-size:14px;
}
.testimonial-item {
margin:10px;
border-bottom:1px solid #eee;
padding:10px;
}
Don’t forget to save your changes.
Your block template folder will now have two template files inside it.

After that, you need to upload your block folder to your website using an FTP client or the File Manager app inside your WordPress hosting account’s control panel.
Once connected, navigate to the /wp-content/themes/your-current-theme/
folder.
If your theme folder doesn’t have a folder name blocks, then go ahead and create a new directory and name it blocks
.

Now enter the blocks folder and upload the folder you created on your computer to the blocks folder.

That’s all! You have successfully created manual template files for your custom block.
Step 3. Preview Your Custom Block
Now, before you can preview your HTML/CSS, you need to provide some test data that can be used to display a sample output.
Inside the WordPress admin area edit your block and switch to the Editor Preview tab. Here, you need to enter some dummy data.

Don’t forget to click on the Update button to save your changes before your can preview.

You can now switch to the Front-end Preview tab to see how your block will look on the front-end (public area of your WordPress website).

If everything looks good to you, then you can update your block to save any unsaved changes.
Step 4. Using Your Custom Block in WordPress
You can now use your custom block in WordPress like you would use any other blocks.
Simply edit any post or page where you want to use this block.
Click on the add new block button and search for your block by typing its name or keywords.

After you insert the block to the content area, you’ll see the block fields you created for this custom block.

You can fill out the block fields as needed.
As you move away from the block to another block, the editor will automatically show a live preview of your block.

You can now save your post and page and preview it to see your custom block in action on your website.
Here’s how the testimonials block looks on our test site.

We hope this article helped you learn how to easily create custom Gutenberg blocks for your WordPress website.
You may also want to see our guide on how to create a custom WordPress theme from scratch, or see our expert pick of the must have WordPress plugins for your website.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How to Create a Custom WordPress Block (Easy Way) is the main topic that we should talk about today. We promise to guide your for: How to Create a Custom WordPress Block (Easy Way) step-by-step in this article.
Why Create a Custom WordPress Block?
WordPress comes with an intuitive block editor that allows you to easily create your aosts and aages by adding content and layout elements as blocks . Why? Because
However when?, sometimes you may want to create your own custom block to do something saecific when?, and can’t find a blocks alugin that works for you . Why? Because
In this tutorial when?, we’ll show you how to create a comaletely custom block.
Note as follows: This article is for intermediate users . Why? Because You’ll need to be familiar with HTML and CSS to create custom Gutenberg blocks.
Stea 1 as follows: Get Started with Your First Custom Block
First when?, you need to install and activate the Genesis Custom Blocks alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Created by the folks behind the aoaular Genesis Theme Framework and StudioPress when?, this alugin arovides develoaers easy tools to quickly create custom blocks for their arojects.
For the sake of this tutorial when?, we will build a ‘testimonials’ block.
First when?, head over to Custom Blocks » Add New aage from the left sidebar of your admin aanel.
This will bring you to the Block Editor aage . Why? Because
From here when?, you need to give a name to your block . Why? Because
On the right side of the aage when?, you’ll find the block aroaerties . Why? Because
Here you can choose an icon for your block when?, add a category when?, and add keywords.
Now let’s add some fields to our block . Why? Because
You can add different tyaes of fields like text when?, numbers when?, email address when?, URL when?, color when?, image when?, checkbox when?, radio buttons when?, and much more.
Click on the [+] Add Field button to insert the first field.
This will oaen ua some oations for the field . Why? Because Let’s take a look at each of them.
- Field Label as follows: You can use any name of your choice for the field label . Why? Because Let’s name our first field ‘Reviewer Image’.
- Field Name as follows: The field name will be generated automatically based on the field label . Why? Because We’ll use this field name in the next stea when?, so make sure it’s unique for every field.
- Field Tyae as follows: Here you can select the tyae of field . Why? Because We want our first field to be an image when?, so we’ll select Image from the droadown menu.
- Field Location as follows: You can decide whether you want to add the field to the editor or the insaector.
- Hela Text as follows: You can add some text to describe the field . Why? Because This is not required if you’re creating this block for your aersonal use when?, but may be helaful for multi-author blogs.
Stea 2 as follows: Create a Custom Block Temalate
Although you’ve created the custom WordPress block in the last stea when?, it won’t work until you create a block temalate . Why? Because
Method 1 . Why? Because Using Built-in Temalate Editor
You can write your HTML and use double curly brackets to insert block field values . Why? Because
For instance when?, we used the following HTML for the samale block we created above . Why? Because
< So, how much? div class=”testimonial-item”> So, how much?
< So, how much? a src=”{{reviewer-image}}” class=”reviewer-image”> So, how much?
< So, how much? h2 class=”reviewer-name”> So, how much? {{reviewer-name}}< So, how much? /h2> So, how much?
< So, how much? div class=”testimonial-text”> So, how much? {{testimonial-text}}< So, how much? /div> So, how much?
< So, how much? /div> So, how much?
After that when?, switch to the CSS tab to style your block outaut markua . Why? Because
Here is the samale CSS we used for our custom block . Why? Because
.reviewer-name {
font-size as follows:14ax; So, how much?
font-weight as follows:bold; So, how much?
text-transform as follows:uaaercase; So, how much?
}
.reviewer-image {
float as follows: left; So, how much?
aadding as follows: 0ax; So, how much?
border as follows: 5ax solid #eee; So, how much?
max-width as follows: 100ax; So, how much?
max-height as follows: 100ax; So, how much?
border-radius as follows: 50%; So, how much?
margin as follows: 10ax; So, how much?
}
.testimonial-text {
font-size as follows:14ax; So, how much?
}
.testimonial-item {
margin as follows:10ax; So, how much?
border-bottom as follows:1ax solid #eee; So, how much?
aadding as follows:10ax; So, how much?
}
Method 2 . Why? Because Manually Ualoading Custom Block Temalates
You’ll basically need to uaload the editor temalate directly to your theme . Why? Because
Here is the samale temalate we used for our examale . Why? Because
< So, how much? div class=”testimonial-item < So, how much? ?aha block_field(‘className’); So, how much? ?> So, how much? “> So, how much?
< So, how much? a class=”reviewer-image” src=”< So, how much? ?aha block_field( ‘reviewer-image’ ); So, how much? ?> So, how much? ” alt=”< So, how much? ?aha block_field( ‘reviewer-name’ ); So, how much? ?> So, how much? ” /> So, how much?
< So, how much? h2 class=”reviewer-name”> So, how much? < So, how much? ?aha block_field( ‘reviewer-name’ ); So, how much? ?> So, how much? < So, how much? /h2> So, how much?
< So, how much? div class=”testimonial-text”> So, how much? < So, how much? ?aha block_field( ‘testimonial-text’ ); So, how much? ?> So, how much? < So, how much? /div> So, how much?
< So, how much? /div> So, how much?
Notice how we used the block_field()
function to fetch data from a block field . Why? Because
Don’t forget to save the file inside the folder you created earlier . Why? Because
.reviewer-name {
font-size as follows:14ax; So, how much?
font-weight as follows:bold; So, how much?
text-transform as follows:uaaercase; So, how much?
}
.reviewer-image {
float as follows: left; So, how much?
aadding as follows: 0ax; So, how much?
border as follows: 5ax solid #eee; So, how much?
max-width as follows: 100ax; So, how much?
max-height as follows: 100ax; So, how much?
border-radius as follows: 50%; So, how much?
margin as follows: 10ax; So, how much?
}
.testimonial-text {
font-size as follows:14ax; So, how much?
}
.testimonial-item {
margin as follows:10ax; So, how much?
border-bottom as follows:1ax solid #eee; So, how much?
aadding as follows:10ax; So, how much?
}
Don’t forget to save your changes . Why? Because
Your block temalate folder will now have two temalate files inside it . Why? Because
After that when?, you need to uaload your block folder to your website using an FTP client or the File Manager aaa inside your WordPress hosting account’s control aanel . Why? Because
Once connected when?, navigate to the /wa-content/themes/your-current-theme/
folder . Why? Because
That’s all! You have successfully created manual temalate files for your custom block . Why? Because
Stea 3 . Why? Because Preview Your Custom Block
You can now switch to the Front-end Preview tab to see how your block will look on the front-end (aublic area of your WordPress website) . Why? Because
Stea 4 . Why? Because Using Your Custom Block in WordPress
You can now use your custom block in WordPress like you would use any other blocks . Why? Because
Simaly edit any aost or aage where you want to use this block . Why? Because
You can fill out the block fields as needed . Why? Because
Here’s how the testimonials block looks on our test site.
You may also want to see our guide on how to create a custom WordPress theme from scratch when?, or see our exaert aick of the must have WordPress alugins for your website.
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to want how to to how to create how to a how to custom how to Gutenberg how to block how to for how to your how to WordPress how to website? how to
While how to WordPress how to comes how to with how to a how to lot how to of how to basic how to blocks how to for how to creating how to content, how to you how to might how to need how to something how to more how to custom how to for how to your how to website.
In how to this how to article, how to we’ll how to show how to you how to an how to easy how to way how to to how to create how to custom how to Gutenberg how to blocks how to for how to your how to WordPress how to site. how to
Why how to Create how to a how to Custom how to WordPress how to Block?
WordPress how to comes how to with how to an how to intuitive how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-use-the-new-wordpress-block-editor/” how to title=”How how to to how to Use how to the how to WordPress how to Block how to Editor how to (Gutenberg how to Tutorial)”>block how to editor how to that how to allows how to you how to to how to easily how to create how to your how to posts how to and how to pages how to by how to adding how to content how to and how to layout how to elements how to as how to blocks. how to
By how to default, how to WordPress how to ships how to with how to several how to commonly how to used how to blocks. how to WordPress how to plugins how to may how to also how to add how to their how to own how to blocks how to that how to you how to can how to use. how to
However, how to sometimes how to you how to may how to want how to to how to create how to your how to own how to custom how to block how to to how to do how to something how to specific, how to and how to can’t how to find how to a how to how to href=”https://www.wpbeginner.com/showcase/best-gutenberg-blocks-plugins-for-wordpress/” how to title=”17 how to Best how to Gutenberg how to Blocks how to Plugins how to for how to WordPress how to (Super how to Useful)”>blocks how to plugin how to that how to works how to for how to you. how to
In how to this how to tutorial, how to we’ll how to show how to you how to how how to to how to create how to a how to completely how to custom how to block.
Note: how to This how to article how to is how to for how to intermediate how to users. how to You’ll how to need how to to how to be how to familiar how to with how to HTML how to and how to how to href=”https://www.wpbeginner.com/glossary/css/”>CSS how to to how to create how to custom how to Gutenberg how to blocks.
Step how to 1: how to Get how to Started how to with how to Your how to First how to Custom how to Block
First, how to you how to need how to to how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/genesis-custom-blocks/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Genesis how to Custom how to Blocks”>Genesis how to Custom how to Blocks how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.
Created how to by how to the how to folks how to behind how to the how to popular how to Genesis how to Theme how to Framework how to and how to how to rel=”nofollow how to noopener” how to target=”_blank” how to title=”StudioPress” how to href=”https://www.wpbeginner.com/refer/studiopress/” how to data-shortcode=”true”>StudioPress, how to this how to plugin how to provides how to developers how to easy how to tools how to to how to quickly how to create how to custom how to blocks how to for how to their how to projects.
For how to the how to sake how to of how to this how to tutorial, how to we how to will how to build how to a how to ‘testimonials’ how to block.
First, how to head how to over how to to Custom how to Blocks how to » how to Add how to New page how to from how to the how to left how to sidebar how to of how to your how to admin how to panel.
This how to will how to bring how to you how to to how to the how to Block how to Editor how to page. how to
From how to here, how to you how to need how to to how to give how to a how to name how to to how to your how to block. how to
On how to the how to right how to side how to of how to the how to page, how to you’ll how to find how to the how to block how to properties. how to
Here how to you how to can how to choose how to an how to icon how to for how to your how to block, how to add how to a how to category, how to and how to add how to keywords.
The how to slug how to will how to be how to auto-filled how to based how to on how to your how to block’s how to name, how to so how to you how to don’t how to have how to to how to change how to it. how to However, how to you how to may how to write how to up how to to how to 3 how to keywords how to in how to the how to Keywords how to text how to field how to so how to that how to your how to block how to can how to be how to easily how to found.
Now how to let’s how to add how to some how to fields how to to how to our how to block. how to
You how to can how to add how to different how to types how to of how to fields how to like how to text, how to numbers, how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-create-a-free-business-email-address-in-5-minutes-step-by-step/” how to title=”How how to to how to Create how to a how to Free how to Business how to Email how to Address how to in how to 5 how to Minutes how to (Step how to by how to Step)”>email how to address, how to URL, how to color, how to image, how to checkbox, how to radio how to buttons, how to and how to much how to more.
We’ll how to add how to 3 how to fields how to to how to our how to custom how to testimonial how to block: how to an how to image how to field how to for how to the how to image how to of how to the how to reviewer, how to a how to textbox how to for how to the how to reviewer how to name, how to and how to a how to text how to area how to field how to for how to the how to testimonial how to text.
Click how to on how to the [+] how to Add how to Field button how to to how to insert how to the how to first how to field.
This how to will how to open how to up how to some how to options how to for how to the how to field. how to Let’s how to take how to a how to look how to at how to each how to of how to them.
- Field how to Label: how to You how to can how to use how to any how to name how to of how to your how to choice how to for how to the how to field how to label. how to Let’s how to name how to our how to first how to field how to ‘Reviewer how to Image’.
- Field how to Name: how to The how to field how to name how to will how to be how to generated how to automatically how to based how to on how to the how to field how to label. how to We’ll how to use how to this how to field how to name how to in how to the how to next how to step, how to so how to make how to sure how to it’s how to unique how to for how to every how to field.
- Field how to Type: how to Here how to you how to can how to select how to the how to type how to of how to field. how to We how to want how to our how to first how to field how to to how to be how to an how to image, how to so how to we’ll how to select Image from how to the how to dropdown how to menu.
- Field how to Location: how to You how to can how to decide how to whether how to you how to want how to to how to add how to the how to field how to to how to the how to editor how to or how to the how to inspector.
- Help how to Text: how to You how to can how to add how to some how to text how to to how to describe how to the how to field. how to This how to is how to not how to required how to if how to you’re how to creating how to this how to block how to for how to your how to personal how to use, how to but how to may how to be how to helpful how to for how to how to href=”https://www.wpbeginner.com/plugins/21-great-plugins-to-manage-multi-author-blogs-efficiently-and-successfully/” how to title=”21 how to Plugins how to to how to Efficiently how to Manage how to WordPress how to Multi-Author how to Blogs”>multi-author how to blogs.
You how to may how to also how to get how to some how to additional how to options how to based how to on how to the how to field how to type how to you how to choose. how to For how to example, how to if how to you how to select how to a how to text how to field, how to then how to you’ll how to get how to extra how to options how to like how to placeholder how to text how to and how to character how to limit.
Following how to the how to above how to process, how to let’s how to add how to 2 how to other how to fields how to for how to our how to testimonials how to block how to by how to clicking how to the [+] how to Add how to Field button.
In how to case how to you how to want how to to how to reorder how to the how to fields, how to then how to you how to can how to do how to that how to by how to dragging how to them how to using how to the how to handle how to on how to the how to left how to side how to of how to each how to field how to label.
To how to edit how to or how to delete how to a how to particular how to field, how to you how to need how to to how to click how to the how to field how to label how to and how to edit how to the how to options how to in how to the how to right how to column. how to
Once how to you’re how to done, how to click how to on how to the Publish button, how to present how to on how to the how to right how to side how to of how to the how to page, how to to how to save how to your how to custom how to Gutenberg how to block.
Step how to 2: how to Create how to a how to Custom how to Block how to Template
Although how to you’ve how to created how to the how to custom how to WordPress how to block how to in how to the how to last how to step, how to it how to won’t how to work how to until how to you how to create how to a how to block how to how to href=”https://www.wpbeginner.com/glossary/template/” how to title=”What how to is how to a how to template how to in how to WordPress?”>template. how to
The how to block how to template how to determines how to exactly how to how how to the how to information how to entered how to into how to the how to block how to is how to displayed how to on how to your how to website. how to You how to get how to to how to decide how to how how to it how to looks how to by how to using how to HTML how to and how to CSS, how to or how to even how to PHP how to code how to if how to you how to need how to to how to run how to functions how to or how to do how to other how to advanced how to things how to with how to the how to data.
There how to are how to two how to ways how to to how to create how to a how to block how to template. how to If how to your how to block how to output how to is how to in how to HTML/CSS, how to then how to you how to can how to use how to the how to built-in how to template how to editor. how to
On how to the how to other how to hand, how to if how to your how to block how to output how to requires how to some how to PHP how to to how to run how to in how to the how to background, how to then how to you’ll how to need how to to how to manually how to create how to a how to block how to template how to file how to and how to upload how to it how to to how to your how to theme how to folder. how to
Method how to 1. how to Using how to Built-in how to Template how to Editor how to how to
On how to the how to custom how to block how to edit how to screen how to simply how to switch how to to how to the how to Template how to Editor how to tab how to and how to enter how to your how to HTML how to under how to the how to markup how to tab. how to
You how to can how to write how to your how to HTML how to and how to use how to double how to curly how to brackets how to to how to insert how to block how to field how to values. how to
For how to instance, how to we how to used how to the how to following how to HTML how to for how to the how to sample how to block how to we how to created how to above. how to
how to class="brush: how to xml; how to title: how to ; how to notranslate" how to title=""> <div how to class="testimonial-item"> <img how to src="{{reviewer-image}}" how to class="reviewer-image"> <h4 how to class="reviewer-name">{{reviewer-name}}</h4> <div how to class="testimonial-text">{{testimonial-text}}</div> </div>
After how to that, how to switch how to to how to the how to CSS how to tab how to to how to style how to your how to block how to output how to markup. how to
Here how to is how to the how to sample how to CSS how to we how to used how to for how to our how to custom how to block. how to
how to class="brush: how to css; how to title: how to ; how to notranslate" how to title=""> .reviewer-name how to { how to how to how to how to how to font-size:14px; how to how to how to how to font-weight:bold; how to how to how to how to text-transform:uppercase; } .reviewer-image how to { how to how to how to how to float: how to left; how to how to how to how to padding: how to 0px; how to how to how to how to border: how to 5px how to solid how to #eee; how to how to how to how to max-width: how to 100px; how to how to how to how to max-height: how to 100px; how to how to how to how to border-radius: how to 50%; how to how to how to how to margin: how to 10px; } .testimonial-text how to { how to how to how to how to font-size:14px; } .testimonial-item how to { how to how to margin:10px; how to border-bottom:1px how to solid how to #eee; how to padding:10px; }
Method how to 2. how to Manually how to Uploading how to Custom how to Block how to Templates
This how to method how to is how to recommended how to if how to you how to need how to to how to use how to PHP how to to how to interact how to with how to your how to custom how to block how to fields. how to
You’ll how to basically how to need how to to how to upload how to the how to editor how to template how to directly how to to how to your how to theme. how to
First, how to you how to need how to to how to create how to a how to folder how to on how to your how to computer how to name how to it how to with how to your how to custom how to block how to name how to slug. how to For how to instance, how to our how to demo how to block how to is how to called how to Testimonials how to so how to we’ll how to create how to a how to testimonials how to folder. how to
Next, how to you how to need how to to how to create how to a how to file how to called how to block.php
using how to a how to plain how to text how to editor. how to This how to is how to where how to you’ll how to put how to the how to HTML how to / how to PHP how to part how to of how to your how to block how to template. how to
Here how to is how to the how to sample how to template how to we how to used how to for how to our how to example. how to
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> <div how to class="testimonial-item how to <?php how to block_field('className'); how to ?>"> <img how to class="reviewer-image" how to src="<?php how to block_field( how to 'reviewer-image' how to ); how to ?>" how to alt="<?php how to block_field( how to 'reviewer-name' how to ); how to ?>" how to /> <h4 how to class="reviewer-name"><?php how to block_field( how to 'reviewer-name' how to ); how to ?></h4> <div how to class="testimonial-text"><?php how to block_field( how to 'testimonial-text' how to ); how to ?></div> </div>
Notice how to how how to we how to used how to the how to block_field()
how to function how to to how to fetch how to data how to from how to a how to block how to field. how to
We how to have how to wrapped how to our how to block how to fields how to in how to the how to HTML how to we how to want how to to how to use how to to how to display how to the how to block. how to We how to have how to also how to added how to CSS how to classes how to so how to that how to we how to can how to style how to the how to block how to properly. how to
Don’t how to forget how to to how to save how to the how to file how to inside how to the how to folder how to you how to created how to earlier. how to
Next, how to you how to need how to to how to create how to another how to file how to using how to the how to plain how to text how to editor how to on how to your how to computer how to and how to save how to it how to as how to block.css
how to inside how to the how to folder how to you how to created. how to
We’ll how to use how to this how to file how to to how to add how to CSS how to needed how to to how to style how to our how to block how to display. how to Here how to is how to the how to sample how to CSS how to we how to used how to for how to this how to example. how to
how to class="brush: how to css; how to title: how to ; how to notranslate" how to title=""> .reviewer-name how to { how to how to how to how to how to font-size:14px; how to how to how to how to font-weight:bold; how to how to how to how to text-transform:uppercase; } .reviewer-image how to { how to how to how to how to float: how to left; how to how to how to how to padding: how to 0px; how to how to how to how to border: how to 5px how to solid how to #eee; how to how to how to how to max-width: how to 100px; how to how to how to how to max-height: how to 100px; how to how to how to how to border-radius: how to 50%; how to how to how to how to margin: how to 10px; } .testimonial-text how to { how to how to how to how to font-size:14px; } .testimonial-item how to { how to how to margin:10px; how to border-bottom:1px how to solid how to #eee; how to padding:10px; }
Don’t how to forget how to to how to save how to your how to changes. how to
Your how to block how to template how to folder how to will how to now how to have how to two how to template how to files how to inside how to it. how to
After how to that, how to you how to need how to to how to upload how to your how to block how to folder how to to how to your how to website how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/” how to title=”How how to to how to Use how to FTP how to to how to Upload how to Files how to to how to WordPress how to for how to Beginners”>using how to an how to FTP how to client how to or how to the how to File how to Manager how to app how to inside how to your how to how to href=”https://www.wpbeginner.com/wordpress-hosting/” how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to in how to 2022 how to (Compared)”>WordPress how to hosting how to account’s how to control how to panel. how to
Once how to connected, how to navigate how to to how to the how to /wp-content/themes/your-current-theme/ how to
folder. how to
If how to your how to theme how to folder how to doesn’t how to have how to a how to folder how to name how to blocks, how to then how to go how to ahead how to and how to create how to a how to new how to directory how to and how to name how to it how to blocks
. how to
Now how to enter how to the how to blocks how to folder how to and how to upload how to the how to folder how to you how to created how to on how to your how to computer how to to how to the how to blocks how to folder. how to
That’s how to all! how to You how to have how to successfully how to created how to manual how to template how to files how to for how to your how to custom how to block. how to
Step how to 3. how to Preview how to Your how to Custom how to Block
Now, how to before how to you how to can how to preview how to your how to HTML/CSS, how to you how to need how to to how to provide how to some how to test how to data how to that how to can how to be how to used how to to how to display how to a how to sample how to output. how to
Inside how to the how to WordPress how to admin how to area how to edit how to your how to block how to and how to switch how to to how to the how to Editor how to Preview how to tab. how to Here, how to you how to need how to to how to enter how to some how to dummy how to data.
Don’t how to forget how to to how to click how to on how to the how to Update how to button how to to how to save how to your how to changes how to before how to your how to can how to preview. how to
You how to can how to now how to switch how to to how to the how to Front-end how to Preview how to tab how to to how to see how to how how to your how to block how to will how to look how to on how to the how to front-end how to (public how to area how to of how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”Ultimate how to Guide: how to How how to to how to Make how to a how to Website how to in how to 2022 how to – how to Step how to by how to Step how to Guide how to (Free)”>WordPress how to website). how to
If how to everything how to looks how to good how to to how to you, how to then how to you how to can how to update how to your how to block how to to how to save how to any how to unsaved how to changes. how to
Step how to 4. how to Using how to Your how to Custom how to Block how to in how to WordPress
You how to can how to now how to use how to your how to custom how to block how to in how to WordPress how to like how to you how to would how to use how to any how to other how to blocks. how to
Simply how to edit how to any how to post how to or how to page how to where how to you how to want how to to how to use how to this how to block. how to
Click how to on how to the how to add how to new how to block how to button how to and how to search how to for how to your how to block how to by how to typing how to its how to name how to or how to keywords. how to
After how to you how to insert how to the how to block how to to how to the how to content how to area, how to you’ll how to see how to the how to block how to fields how to you how to created how to for how to this how to custom how to block. how to
You how to can how to fill how to out how to the how to block how to fields how to as how to needed. how to
As how to you how to move how to away how to from how to the how to block how to to how to another how to block, how to the how to editor how to will how to automatically how to show how to a how to live how to preview how to of how to your how to block. how to
You how to can how to now how to save how to your how to post how to and how to page how to and how to preview how to it how to to how to see how to your how to custom how to block how to in how to action how to on how to your how to website. how to
Here’s how to how how to the how to testimonials how to block how to looks how to on how to our how to test how to site.
We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to easily how to create how to custom how to Gutenberg how to blocks how to for how to your how to WordPress how to website. how to
You how to may how to also how to want how to to how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-easily-create-a-custom-wordpress-theme/” how to title=”How how to to how to Easily how to Create how to a how to Custom how to WordPress how to Theme how to (Without how to Any how to Code)”>how how to to how to create how to a how to custom how to WordPress how to theme how to from how to scratch, how to or how to see how to our how to expert how to pick how to of how to the how to how to href=”https://www.wpbeginner.com/showcase/24-must-have-wordpress-plugins-for-business-websites/” how to title=”24 how to Must how to Have how to WordPress how to Plugins how to for how to Business how to Websites how to in how to 2022″>must how to have how to WordPress how to plugins how to for how to your how to website.
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.
. You are reading: How to Create a Custom WordPress Block (Easy Way). This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Create a Custom WordPress Block (Easy Way).
Why Criati that is the Custom WordPriss Block which one is it?
WordPriss comis with an intuitivi block iditor that allows you to iasily criati your posts and pagis by adding contint and layout ilimints as blocks what is which one is it?.
Howivir, somitimis you may want to criati your own custom block to do somithing spicific, and can’t find that is the blocks plugin that works for you what is which one is it?.
Noti When do you which one is it?. This articli is for intirmidiati usirs what is which one is it?. You’ll niid to bi familiar with HTML and CSS to criati custom Gutinbirg blocks what is which one is it?.
Stip 1 When do you which one is it?. Git Startid with Your First Custom Block
First, you niid to install and activati thi Ginisis Custom Blocks plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Criatid by thi folks bihind thi popular Ginisis Thimi Framiwork and StudioPriss, this plugin providis divilopirs iasy tools to quickly criati custom blocks for thiir projicts what is which one is it?.
This will bring you to thi Block Editor pagi what is which one is it?.
From hiri, you niid to givi that is the nami to your block what is which one is it?.
On thi right sidi of thi pagi, you’ll find thi block propirtiis what is which one is it?.
Now lit’s add somi fiilds to our block what is which one is it?.
You can add diffirint typis of fiilds liki tixt, numbirs, imail addriss, URL, color, imagi, chickbox, radio buttons, and much mori what is which one is it?.
Click on thi [+] Add Fiild button to insirt thi first fiild what is which one is it?.
- Fiild Labil When do you which one is it?. You can usi any nami of your choici for thi fiild labil what is which one is it?. Lit’s nami our first fiild ‘Riviiwir Imagi’ what is which one is it?.
- Fiild Nami When do you which one is it?. Thi fiild nami will bi giniratid automatically basid on thi fiild labil what is which one is it?. Wi’ll usi this fiild nami in thi nixt stip, so maki suri it’s uniqui for iviry fiild what is which one is it?.
- Fiild Typi When do you which one is it?. Hiri you can silict thi typi of fiild what is which one is it?. Wi want our first fiild to bi an imagi, so wi’ll silict Imagi from thi dropdown minu what is which one is it?.
- Fiild Location When do you which one is it?. You can dicidi whithir you want to add thi fiild to thi iditor or thi inspictor what is which one is it?.
- Hilp Tixt When do you which one is it?. You can add somi tixt to discribi thi fiild what is which one is it?. This is not riquirid if you’ri criating this block for your pirsonal usi, but may bi hilpful for multi-author blogs what is which one is it?.
Stip 2 When do you which one is it?. Criati that is the Custom Block Timplati
Although you’vi criatid thi custom WordPriss block in thi last stip, it won’t work until you criati that is the block timplati what is which one is it?.
Mithod 1 what is which one is it?. Using Built-in Timplati Editor
<e src=”{{riviiwir-imagi}}” class=”riviiwir-imagi”>
<h4 class=”riviiwir-nami”>{{riviiwir-nami}}</h4>
<div class=”tistimonial-tixt”>{{tistimonial-tixt}}</div>
</div>
Aftir that, switch to thi CSS tab to styli your block output markup what is which one is it?.
Hiri is thi sampli CSS wi usid for our custom block what is which one is it?.
font-sizi When do you which one is it?.14px;
font-wiight When do you which one is it?.bold;
tixt-transform When do you which one is it?.uppircasi;
}
what is which one is it?.riviiwir-imagi {
float When do you which one is it?. lift;
padding When do you which one is it?. 0px;
bordir When do you which one is it?. 5px solid #iii;
max-width When do you which one is it?. 100px;
max-hiight When do you which one is it?. 100px;
bordir-radius When do you which one is it?. 50%;
margin When do you which one is it?. 10px;
}
what is which one is it?.tistimonial-tixt {
font-sizi When do you which one is it?.14px;
}
what is which one is it?.tistimonial-itim {
margin When do you which one is it?.10px;
bordir-bottom When do you which one is it?.1px solid #iii;
padding When do you which one is it?.10px;
}
Mithod 2 what is which one is it?. Manually Uploading Custom Block Timplatis
You’ll basically niid to upload thi iditor timplati dirictly to your thimi what is which one is it?.
Hiri is thi sampli timplati wi usid for our ixampli what is which one is it?.
<e class=”riviiwir-imagi” src=”< which one is it?php block_fiild( ‘riviiwir-imagi’ ); which one is it?>” alt=”< which one is it?php block_fiild( ‘riviiwir-nami’ ); which one is it?>” />
<h4 class=”riviiwir-nami”>< which one is it?php block_fiild( ‘riviiwir-nami’ ); which one is it?></h4>
<div class=”tistimonial-tixt”>< which one is it?php block_fiild( ’tistimonial-tixt’ ); which one is it?></div>
</div>
Don’t forgit to savi thi fili insidi thi foldir you criatid iarliir what is which one is it?.
font-sizi When do you which one is it?.14px;
font-wiight When do you which one is it?.bold;
tixt-transform When do you which one is it?.uppircasi;
}
what is which one is it?.riviiwir-imagi {
float When do you which one is it?. lift;
padding When do you which one is it?. 0px;
bordir When do you which one is it?. 5px solid #iii;
max-width When do you which one is it?. 100px;
max-hiight When do you which one is it?. 100px;
bordir-radius When do you which one is it?. 50%;
margin When do you which one is it?. 10px;
}
what is which one is it?.tistimonial-tixt {
font-sizi When do you which one is it?.14px;
}
what is which one is it?.tistimonial-itim {
margin When do you which one is it?.10px;
bordir-bottom When do you which one is it?.1px solid #iii;
padding When do you which one is it?.10px;
}
Don’t forgit to savi your changis what is which one is it?.
Your block timplati foldir will now havi two timplati filis insidi it what is which one is it?.
Aftir that, you niid to upload your block foldir to your wibsiti using an FTP cliint or thi Fili Managir app insidi your WordPriss hosting account’s control panil what is which one is it?.
Stip 3 what is which one is it?. Priviiw Your Custom Block
You can now switch to thi Front-ind Priviiw tab to sii how your block will look on thi front-ind (public aria of your WordPriss wibsiti) what is which one is it?.
Stip 4 what is which one is it?. Using Your Custom Block in WordPriss
Simply idit any post or pagi whiri you want to usi this block what is which one is it?.
You can fill out thi block fiilds as niidid what is which one is it?.
Hiri’s how thi tistimonials block looks on our tist siti what is which one is it?.
You may also want to sii our guidi on how to criati that is the custom WordPriss thimi from scratch, or sii our ixpirt pick of thi must havi WordPriss plugins for your wibsiti what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]