Support

Account

Home Forums Bug Reports acf_register_block default align

Helping

acf_register_block default align

    • sidas

    • April 17, 2019 at 6:28 pm

    Hello everyone, so I want to ask how this default align works for acf_register_block. Because when I add align like this:

    acf_register_block([
    	[name] => block-hero-small-acf 
    	[title] => Hero Small 
    	[description] => Used to create hero with image and list 
    	[category] => formatting 
    	[icon] => format-image 
    	[keywords] => Array ( 
    		[0] => hero 
    		[1] => image 
    	) 
    	[mode] => edit 
    	[render_callback] => sage_blocks_callback 
    	[supports] => Array ( 
    		[align] => false
    	) 
    	[align] => full
    ]);

    You can see [align] => full at the end. THen nothing happens, BE editor still shows as default?

    • JasperV

    • April 30, 2019 at 9:41 pm

    To be able to use full and wide align, you must run a theme that supports it, this requires the theme to set an option and add some CSS.
    Twentynineteen supports this, but if you’re running your own theme you can add support for it yourself. How to do this is written in this article.

    Now about the bit of code you sent, setting 'align' => 'full' should be correct and set the default alignment to full. Maybe try recreating your block to see if it’s set to full then?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.