Support

Account

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.