Home Forums Gutenberg ACF Field Data in Block (HTML) Template


ACF Field Data in Block (HTML) Template

  • Hello,

    I have ACF fields for a post type and I’d like to render that ACF data in a block template for a single post view. As of the current version of WordPress, block templates and template parts are created using HTML files, to which blocks are added via HTML comments, like below:

    <!-- wp:post-content {"layout":{"inherit":true}} /-->

    I can create a classic PHP page template instead and use get_field(), etc. like normal, but I’m wondering how ACF field data gets queried and displayed in these kinds of block templates (or if that’s even possible). WordPress has built-in dynamic template parts for things like “wp:post-content” or “wp:post-featured-image”, so I was wondering if there is an equivalent for something like “acf:field-name” to display the data of a “field-name” as a block.

    Thanks for any help!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.