Home › Forums › Front-end Issues › Passing get_sub_field() to JS script › Reply To: Passing get_sub_field() to JS script
John,
Thanks for the reply. After much tinkering I figured out that I need to include the have_rows loop in the functions.php to obtain the desired sub_field data. But the issue is that when I pass that data over to my variable as an array, I get all the urls concatenated as one string. This only happens when a page has multiple rows not when there is only 1.
Since this is more of a general PHP question and not ACF specific, I’ll mark your replay as the solution.
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.