Support

Account

Home Forums Front-end Issues Passing get_sub_field() to JS script Reply To: Passing get_sub_field() to JS script

  • In functions.php you need to supply the post ID to get the values from and you also need a have_rows() loop to get the sub field. Basically you need all the looping you have in the page with the addition of the post ID to get values from, this is the second optional parameter in most ACF functions like get_field('my_field', $post_id) and have_rows('my_field', $post_id)