Home › Forums › General Issues › Looping over sub fields in different ways › Reply To: Looping over sub fields in different ways
That looks like it’s for a group field. This will also work for sub fields of a group field
$links = get_field('footer_legal_links', settings_id());
I personally find this easier to look at but they have the same meaning. But I always try to comment code when using a group field that it is a group field.
The only time you’re going to need to use have_rows() is if you have a repeater as a sub field of a group field so that you can loop over the repeater. Without the parent have_rows() on the group field you would have to get the repeater as an array an loop over the content of the array.
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.