Thanks for the responses! The shortcode idea is a good one and works nicely, and I’ll use it in the future when I need to quickly access ACF data from an HTML template.
I ended up just making new ACF blocks for the content that I wanted to display, and then inserting those blocks into the HTML templates. If you or anyone else stumbling on this doesn’t know, ACF has a handy register block function that can be used to quickly register a block without going through the endorsed WordPress route (which uses JSX and has separate Save and Edit functions for rendering).
I registered a person block, for instance, and then could add it to my HTML template with the following code:
Then I can supply that block a good old fashioned PHP template during registration, allowing me to fully access the ACF field data from the render template and to further dictate how that block is displayed in the HTML template.
Like you said, this solution doesn’t seem elegant, nor is it efficient if you need to do it for many different types of posts.
Viewing 1 post (of 1 total)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Clients need flexibility. Developers need a repeatable workflow that doesn’t have a steep learning curve. See how digital marketing agency Noiza found both with Advanced Custom Fields in our latest case study.https://t.co/BxQAy6COJt