Home › Forums › General Issues › Display field groups based on a selection field from another field group › Reply To: Display field groups based on a selection field from another field group
If you want to use the get_field() function outside The Loop, you need to provide the second parameter with the post ID. This page should give you more idea about it: http://www.advancedcustomfields.com/resources/get_field/.
You should be able to do it like this:
$value = get_field('pp_choose_template', $options['post_id']);
But it means that you need to save the “pp_choose_template” field first before the rule is applied.
I hope this makes sense.
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.