Support

Account

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.