Home › Forums › Gutenberg › Cannot access ACF Field Value for CPT post when called via Gutenberg Block › Reply To: Cannot access ACF Field Value for CPT post when called via Gutenberg Block
I was able to solve my own question – not entirely sure why, as i’m in the loop but by adding the explicit $post-ID to the_field call. IE:
<?php the_field('location_color', $post->ID); ?>
I was able to access the fields. If anyone has the explanation for why that is, i’d be curious to hear it. But there’s the solution regardless.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.