Hello!
I am trying to get my page built out. I have a custom archive template built, with a get_posts foreach loop created. When I echo out the other information within the object, they are all different posts, BUT when I insert some of my custom field data within the foreach loop, it only displays the fields for the FIRST post, even though the other posts are streaming in to the archive within the loop just fine.
Any ideas about what is happening and how to fix it?
Cheers!
You are outside of the normal WordPress loop so you have to pass the ID to your get_field function like this:
foreach($myposts as $mypost) {
echo get_field('myfield', $mypost->ID);
}