Very helpful and very clear! Will definitely be using, but more than anything, great learning experience because I finally understand what ACF blocks are. Yes! Deeper dive(s) into ACF blocks would be great!
@BrianCoords Жыл бұрын
Sounds great! I have a few more ACF Blocks ideas on the way.
@umidjonzoxidov3 ай бұрын
Very useful, thank you!
@yasershahian31346 ай бұрын
Absolutely love your videos. keep up the good work.
@xSalamz Жыл бұрын
Thank you so much. I was doing it the old way by using acf_register_block_type() but I will start to do the native approach.
@tevfik7 Жыл бұрын
This video is golden. Hope you make more videos.
@BrianCoords Жыл бұрын
Thanks for watching!
@faisalahammad Жыл бұрын
Thanks man 👍
@binaryfire3 ай бұрын
Great video mate - you've got a great way of explaining things. A couple of things I'd love to see: 1) How to hardcode ACF fields in the plugin instead of pulling them from the UI (so they're self-contained in the plugin). 2) How can we allow users to set their own palette colors? I'm using ACF blocks as a replacement for flexible content and don't plan on using core blocks any time soon. So would the customizer still be the best way to handle global styles for my use case? Or is there a Gutenberg equivalent that will work just as well with ACF blocks?
@BrianCoords3 ай бұрын
Thanks! These are great ideas for future videos. 1) I'd look into ACF's "Local JSON" feature as the go-to way to store ACF files locally in your theme. www.advancedcustomfields.com/resources/local-json/ Also if you want to prevent your users from seeing the ACF admin screen, you can hide it from them: www.advancedcustomfields.com/resources/how-to-hide-acf-menu-from-clients/ 2) You can override the default colors in the ACF color picker: www.advancedcustomfields.com/resources/javascript-api/#filters-color_picker_args . I could imagine setting that up with a custom ACF options field or else pulling the color values directly from theme.json 🤔
@binaryfire3 ай бұрын
@@BrianCoords Thanks! I've been planning to dig more into local JSON. Regarding 2 - the issue is that this theme + blocks combo will be used by multiple clients in the same industry. Which means the palette needs to be both changeable in the UI, and I want to provide some preset choices too. That's easy to do with something like Kirki but seems a lot more limited with the Gutenberg global styles panel. Unless there's a way of adding custom sections and controls to the GB global styles panel? I'm also not sure how I'd access GB global styles in ACF blocks and if they're just limited to client side things like CSS variables. Whereas getting customizer options anywhere in PHP is easy, and they can include more complex db-stored stuff like layout configs etc.
@taunado3 ай бұрын
Thanks. Is the new Wordpress FSE with blocks simpler to do this? Or is ACF approach still the way, if that even makes sense?
@BrianCoords3 ай бұрын
Carousels are always hard because they're interactive - there may be some block plugins that do it, I could even imagine it coming to core one day, but for now a custom block, like an ACF Block, is the best way,
@taunado3 ай бұрын
@@BrianCoords Sorry I didn't explain what I mean and thanks for the reply. I mean is ASF outdated since Wordpress has introduced FSE and a complete blocks workflow? So we can develop natively without ACF? Basically is ACF becoming redundant?
@BrianCoords3 ай бұрын
@@taunado Oh I see. No I think there's always a great use case for ACF. It gives you a UI for things like custom fields and settings pages. If you aren't interested in learning React, you can build custom blocks with it very easily. There's still a lot of reasons a developer might want to use ACF.
@taunado3 ай бұрын
@@BrianCoords Thanks! I've learned React, just got to learn PHP now.
@mihirvaja37288 ай бұрын
Works great for the build, but I noticed its still loading the scripts and styles on other pages even if the block is not being used, any ideas why? Have followed the tutorial exactly Edit: I should mention this is on a custom theme, not the default WordPress theme. Its the only difference I can think of but surely this isn't why?
@BrianCoords8 ай бұрын
So there's a filter that determines whether your site will load ALL block assets or just the assets on the current page. It's typically true on block themes but not on custom themes. Take a look here and see if this helps: developer.wordpress.org/reference/hooks/should_load_separate_core_block_assets/
@thebuildreview Жыл бұрын
Hi Brian, Thanks for the video. Is it possible to display woocommerce products in your carousel? I'm also researching if ACF can handle woocommerce native fields, but can't find any useful articles on the web...
@BrianCoords Жыл бұрын
Yeah that's a great question. Since WooCommerce products appear as a custom post type, you should be able to update the post/relationship field to load the "Products" CPT instead of just posts.
@davisvilums11 ай бұрын
Hi mate, wonderful videos. How do you "auto generate" the initial plugin files?
@BrianCoords11 ай бұрын
Thanks! If I remember correctly, I used wp-cli to generate the initial plugin for this one. Since I use LocalWP for local development, it has wp-cli built right in! I also probably deleted some of the stuff I didn't need, like the stuff for translation, the grunt file, etc. Here's a link: developer.wordpress.org/cli/commands/scaffold/plugin/
@ureckonsir8024 Жыл бұрын
Can you make a video on a different type of block with ACF and not so fast in pace do it so beginners can understand
@BrianCoords Жыл бұрын
I'm planning a longer series with more step-by-step basics. Let me know if there are any particular parts of ACF Blocks that you'd like me to cover
@bclaw10 ай бұрын
Thank you for sharing this video. I get "No posts selected" when trying to preview. Do you have an idea where my error is?
@bclaw10 ай бұрын
I downloaded your repo; everything worked, except for some minor css issues. I'm still wondering why I was getting "No posts selected"?? Maybe a naming issue somewhere...
@BrianCoords10 ай бұрын
Hmm are you trying to get posts or are you trying to get a different post type?
@vincentagasen13686 ай бұрын
I am running on the same issue and I am not getting a different post type. Just the native one. Any idea what could be the reason? (Thanks for this video)@@BrianCoords
@vincentagasen13686 ай бұрын
Found the answer. The get_field() should reference the Field Name you entered when creating the ACF
@BrianCoords6 ай бұрын
In your ACF field or on the front end of your site? @@vincentagasen1368
@ureckonsir8024 Жыл бұрын
give link of where you are coping the code bro ]
@BrianCoords Жыл бұрын
The full code is linked in the description but let me know if I'm missing anything else: github.com/bacoords/example-acf-carousel-block