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!
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.