Answered my own question, was taking the schema to literally.
For anyone else looking:
"layout": {
"type": "object",
"default": {
"type": "constrained"
}
}
Also make sure the “layout: true” is set within the “supports” array.
Scrap that, I hadn’t added the Post Post Type to the Post Type array when registering the Block!
@pierrebalian Thanks so much for this, worked a treat and was easily tweaked for it’s intended purpose on a website i’m working on.
Hi pagol, there’s a few examples relating to what you’re talking about on the documentation page https://www.advancedcustomfields.com/resources/image/, just need to make sure you declare a custom image size in your functions.php. If you’ve not done that already have a look here -https://developer.wordpress.org/reference/functions/add_image_size/
Hi mmjaeger, As far as I know Blocks save their content within . the Post Object itself, here’s a snippet from the original ACF Blocks blog post:
Metaboxes save data as “meta” (individual bits of data connected to the post via the wp_postmeta table) which allows the developer full control over when and where they appear within the theme template files – perfect for bespoke websites.
Blocks save their data within the post_content value (as JSON within HTML comments) which allows the user full control over when and where they appear within the post’s content – perfect for blog posts or rich content areas.
Basically means the content from your original Custom Field setup won’t show in your new block as it’s in a different place.
Hi MajorPayne, you have access to the WYSIWIG editor as a Custom Field type, you can rtead more about it here – https://www.advancedcustomfields.com/resources/wysiwyg-editor/ there’s various options in terms of the functionality you want to allow the client to have.
Hi mmjaeger, have you checked out the FontAwesome Add-on plugin? https://wordpress.org/plugins/advanced-custom-fields-font-awesome/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.