Can you please update the title of your video with the word "Pro" at the end of the first line? This was a waist of 15 minutes of my life until I took time to read this first comment.
Really good tutorial, thanks! I tried another tutorial about 6 months ago which made this process seem so overly complicated that I gave up but I'm glad I came across this. I was able to get something going really quickly. I agree with you, it is a game-changer!
Thank You !!!!!! That's awesome :) Gutenberg Blocks to learn is a pain because of all the JavaScript. This is a great solution. You helped me a lot with this. I appreciate it :)
Good tutorial, except I feel that you left out two important items. That being the block ID and the CSS for the block. The block ID is what makes each block unique and allows the block to be re-usable. And of course the CSS for styling the block.
Yes great tutorial, but that changes adding content into ACF fields from the main working area (as it used to be, and still is for all other blocks), to adding the acf content to the right sidebar and only displaying the data in the content area? doesn't that like change / break the entire logic of adding content in the blocks themselves?
Big thanks for making life easier. One request, can you add word file in the description with code for us. I am not that technical but good at copy paste..lol, it will add more value to the vides😀
Idea: create a custom post type for Blocks with ACF fields for Title, Icon, Template, Desc, Keywords and at acf init: loop through hese CPTs and register them.
That's a good solution especially if you need repeater functionality but don't want to buy the premium version. What they mean is : create a custom post type "block" and then in the admin instead of choosing block, choose post type and select the name of your custom post type. Then add the fields you want. Go create a new "block" and you'll see the acf fields you created. What good about this option is you can use the loop to show your created blocks which will mimick a repeater.
This is amazing feature. Have been using ACF since many years now but didn't notice they launched this feature for Gutenberg. Best feature to say goodbye to Page builders :) Is it possible to put all the fields in left side area somewhere instead of right sidebar? That area is too narrow to fit all the fields.
Thank you so much for the great video! I actually use Block Lab to create the blocks, but I've ACF installed as well, do you suggest I remake all blocks in ACF, or having both plugins is fine? Thank you so much!
Fantastic Tut WPCasts. Is it possible to do this as a plugin rather than modify the theme? I wish to continue to have the functionality even if theme is swapped.
Has anyone been able to use the render_callback parameter properly? I pass a function that returns some html but it never outputs, neither frontend or backend. render_template works great though. The only problem with that is coupling my templates with acf functions which I would like to avoid
My team and I are having some issues on trying to get the fields to display. We are trying to create a searchable database using the ACF plugin. Could you please help @WPcasts ? We’ll pay you for your time.
Hey Alex, great stuff here. Do you plan on doing more ACF tuts? What am i interested in particular is ACF speed. Recently I've discovered that get_post_meta is much faster than get_field. I mean ACF is great plugin, takes WP on another level. But ... if there is a lot of data coming from DB it just slows down response significantly. In some cases I've managed to work around it using IntersectionObserver() and ajax. But it seems to be an "overkill" in some cases. It'd be nice if you could show us how you deal with it. Tnx.
I typically just use get_field, however there is a case to be made for using get_post_meta instead. I wish there was a way to have all the ACF fields combined into a single meta field in JSON...
This is the code I put in the functions.php yet I don't have the block showing up. What I'm I doing wrong? if(function_exists('acf_register_block_type')){ add_action('acf/init','register_acf_block_types'); } function register_acf_block_types(){ acf_register_block_type( array( 'name'=>'toaster', 'title'=>__('Toaster'), 'description'=>__('A custom toaster block'), 'render_template'=>'template-parts/blocks/toaster/toaster.php', 'icon'=>'editor-paste-text', 'keywords'=>array('toaster','product') ) ); }
@@Labyrinthman Thank you so much for your quick response. I simply mistyped something. It works like magic now. Thank you so much. I will share my code here if someone needs it.
The Repeater field type is not there in the Advanced Custom Fields plugin unless I pay ridiculous yearly fees to release it. What a misleading and wasting time video.
Reminder: To be able to create a "Block" you'll need the Advanced Custom Fields PRO plugin. Also, don't forget to subscribe!
Can you please update the title of your video with the word "Pro" at the end of the first line? This was a waist of 15 minutes of my life until I took time to read this first comment.
@@kensleylewis use Carbon Fields instead. It's absolutely free)
You sir just changed my life forever thank you!
Really good tutorial, thanks! I tried another tutorial about 6 months ago which made this process seem so overly complicated that I gave up but I'm glad I came across this. I was able to get something going really quickly. I agree with you, it is a game-changer!
Cool. ACF has improved and we now use Block.json and the registering of block function.
Thank You !!!!!! That's awesome :) Gutenberg Blocks to learn is a pain because of all the JavaScript. This is a great solution. You helped me a lot with this. I appreciate it :)
Good tutorial, except I feel that you left out two important items. That being the block ID and the CSS for the block. The block ID is what makes each block unique and allows the block to be re-usable. And of course the CSS for styling the block.
Thanks for bringing this up! In the next video that covers this I’ll make sure to circle back to those two topics! Cheers! 👍
Thank you for this, exactly what i've been looking for.
Excellent tutorial. Very easy to understand. Thanks
This is exactly the tutorial I needed. Thank you!
This was exactly I needed. Thanks
Perfect for the new bee.
Yes great tutorial, but that changes adding content into ACF fields from the main working area (as it used to be, and still is for all other blocks), to adding the acf content to the right sidebar and only displaying the data in the content area? doesn't that like change / break the entire logic of adding content in the blocks themselves?
My toaster is not showing on the front end. Did you put any special settings in ACF? Can you share the source code please :)
Big thanks for making life easier. One request, can you add word file in the description with code for us. I am not that technical but good at copy paste..lol, it will add more value to the vides😀
hi, I just want my post to have one field of custom text which will be used for dynamic content, shall I use ACF or Custom Post Types?
Realy good tutorial, thanks!
Is this only for ACF Pro? I don't see Block in the standard version of ACF.
Freaking awesome, total game changer. Thanks for making this!
This is awesome! Thank you for the best video on how to do this!
You're very welcome!
You said something about a video where you talked about that table code? Please provide a link to it.
Idea: create a custom post type for Blocks with ACF fields for Title, Icon, Template, Desc, Keywords
and at acf init: loop through hese CPTs and register them.
Can you explain how you would do this further?
That's a good solution especially if you need repeater functionality but don't want to buy the premium version.
What they mean is : create a custom post type "block" and then in the admin instead of choosing block, choose post type and select the name of your custom post type. Then add the fields you want. Go create a new "block" and you'll see the acf fields you created. What good about this option is you can use the loop to show your created blocks which will mimick a repeater.
How can I do if im want a "wrapper-block"? A template like:
This is amazing feature. Have been using ACF since many years now but didn't notice they launched this feature for Gutenberg. Best feature to say goodbye to Page builders :)
Is it possible to put all the fields in left side area somewhere instead of right sidebar? That area is too narrow to fit all the fields.
Thank you
Thank you so much for the great video! I actually use Block Lab to create the blocks, but I've ACF installed as well, do you suggest I remake all blocks in ACF, or having both plugins is fine? Thank you so much!
Will this work with Kadence?
How would I add CSS for the block for use in the backend?
Cool! Thanks
Thank you x1000!
Fantastic Tut WPCasts. Is it possible to do this as a plugin rather than modify the theme? I wish to continue to have the functionality even if theme is swapped.
Yes! That is possible :)
Any thoughts on how that could be done? Can you please share some code or provide links to a tut?
@@vj-design Yes I agree we would LUV a tutorial as to how this can be done as a plugin!
Thanks for the cast. Is it possible to load block specific scripts only?
Thank you so much! This helped me so much. Will there be any more videos on this topic?
Definitely!
Has anyone been able to use the render_callback parameter properly? I pass a function that returns some html but it never outputs, neither frontend or backend. render_template works great though. The only problem with that is coupling my templates with acf functions which I would like to avoid
My team and I are having some issues on trying to get the fields to display. We are trying to create a searchable database using the ACF plugin. Could you please help @WPcasts ? We’ll pay you for your time.
Don't worry about that. Do you have a repository?
Man, fantastic video!
Thank you! I really appreciate it. I hope you learned something!
Hey Alex, great stuff here. Do you plan on doing more ACF tuts? What am i interested in particular is ACF speed. Recently I've discovered that get_post_meta is much faster than get_field. I mean ACF is great plugin, takes WP on another level. But ... if there is a lot of data coming from DB it just slows down response significantly. In some cases I've managed to work around it using IntersectionObserver() and ajax. But it seems to be an "overkill" in some cases. It'd be nice if you could show us how you deal with it. Tnx.
I typically just use get_field, however there is a case to be made for using get_post_meta instead. I wish there was a way to have all the ACF fields combined into a single meta field in JSON...
brilliant
How to show Gutenberg Block custom in tamplate custom?
any option ? dowload this code?
After creating this in the editor I cannot get the block to display on my page. Any Ideas?
Yes! Me too, I use in page but it only displays WP default block, and custom Block it does not show
Is there any other way that doesn't require coding?
This helped me out but heads up there seems to be a newer (better) way to do this. This seems outdated.
This is the code I put in the functions.php yet I don't have the block showing up.
What I'm I doing wrong?
if(function_exists('acf_register_block_type')){
add_action('acf/init','register_acf_block_types');
}
function register_acf_block_types(){
acf_register_block_type(
array(
'name'=>'toaster',
'title'=>__('Toaster'),
'description'=>__('A custom toaster block'),
'render_template'=>'template-parts/blocks/toaster/toaster.php',
'icon'=>'editor-paste-text',
'keywords'=>array('toaster','product')
)
);
}
add_action('acf/init', 'my_acf_init_block_types');
function my_acf_init_block_types()
{
// Check function exists.
if (function_exists('acf_register_block_type')) {
// register a testimonial block.
acf_register_block_type(array(
'name' => 'toaster',
'title' => __('Toaster'),
'description' => __('A custom toaster block'),
'render_template' => 'template-parts/blocks/toaster/toaster.php',
'icon' => 'editor-paste-text',
'keywords' => array('toaster', 'product')
));
}
}
I have the same problem, everything should be OK, but it does not create a block. How come?
@@tucado Are you using ACF PRO?
@@Labyrinthman Thank you so much for your quick response. I simply mistyped something. It works like magic now. Thank you so much. I will share my code here if someone needs it.
which editor is this?
Visual Studio Code
fr.wordpress.org/plugins/acf-extended/ for a best customisation of blocks
Advanced Fields seems complicated
The Repeater field type is not there in the Advanced Custom Fields plugin unless I pay ridiculous yearly fees to release it. What a misleading and wasting time video.