Support

Account

Home Forums Gutenberg Adding Block Styles to an ACF Custom Block Reply To: Adding Block Styles to an ACF Custom Block

  • Adding the ‘sytles’ attribute worked for me. On the front-end if you want the style classes to show up on the HTML, you can use the $block['className'] global variable.

    
    $className = 'acf-card';
    if( !empty($block['className']) ) {
        $className .= ' ' . $block['className'];
    }
    

    I found this in the blocks documentation under “3. Render the Block”
    https://www.advancedcustomfields.com/resources/blocks/