I have a WordPress template based on Sage which is using the new ACF blocks feature and Blade templates. Everything is working just fine.
I have a Gutenberg block that pulls some posts with WP_Query then loops through them this way:
$projects = new WP_Query(…);
while ($projects->have_posts()): $projects->the_post();
the_title(); // works
the_ID() // works
the_field('location') // does not work
the_field('location', get_the_ID()); // works
Do you have any idea why the_field() fails without passing an ID even though the_post seems to be set up properly (because the_ID() works correctly)?
Thanks in advance,
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users