That is what i tried to show in first post:
1. In custom page template file (so global $post variable is set already) i create secondary loop using get_pages() (btw using WP_Query doesnt change anything).
2. I iterate through get_pages() results and use setup_postdata() to set global variables up.
3. Right before get_field() call i check $post value and its correct. Right after the call i check $post again and see that now it holds value of global $post.
4. Whole this thing seems happens only on first iteration. The rest of the loop data seems correct.
Finally if im commenting out get_field() call then $post values are correct for entire secondary loop. So i am pretty sure that whole this thing has something to do with ACF 🙂
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!
© 2023 Advanced Custom Fields.