admin管理员组

文章数量:1122832

I am using ACF fields to create custom Gutenberg Blocks. I am running into an issue however where I need to go in and out of a container div depending on the block. So I cant just add a container div around the_content();

What I'm trying to do is add a class to each of the standard Gutenberg blocks, so I can add the container styles to each of those blocks, making it easier to go in and out of the container div for better content styling.

Is there a way to accomplish this?

I am using ACF fields to create custom Gutenberg Blocks. I am running into an issue however where I need to go in and out of a container div depending on the block. So I cant just add a container div around the_content();

What I'm trying to do is add a class to each of the standard Gutenberg blocks, so I can add the container styles to each of those blocks, making it easier to go in and out of the container div for better content styling.

Is there a way to accomplish this?

Share Improve this question asked Nov 12, 2018 at 19:31 user9664977user9664977 3775 silver badges12 bronze badges 2
  • Related / possible duplicates: wordpress.stackexchange.com/a/304145/3898, wordpress.stackexchange.com/a/308044/3898 – Ian Dunn Commented Apr 22, 2019 at 20:21
  • This is what group blocks and block styles/variants are meant to do – Tom J Nowell Commented Nov 18, 2020 at 20:57
Add a comment  | 

1 Answer 1

Reset to default 1

You can use the group block to act as a container for a core block or any other block...

本文标签: How to Add a Container Class to Standard Gutenberg Blocks