Your second lot of code looks like it should work. You have followed the example code from ACF, however, I think the ‘post_type’ => ‘any’ is your issue. I don’t think this is possible. Can you confirm the docs about this?
Welcome
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.