Home › Forums › ACF PRO › Get Value of Sub-Field Outside of While Loop › Reply To: Get Value of Sub-Field Outside of While Loop
When calling for values of subfields, you shouldn’t specify the $post_id
argument as in the_field()
function call, e.g. your 'option'
here: the_sub_field('link_type', 'option')
. You should just leave it like that: the_sub_field('link_type')
. This might be the cause of your problem, although I am not really sure.
I suggest you to take a closer look on how nested loops are handled in the_sub_field()
function documentation in the “Examples” section.
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.