Support

Account

Home Forums Add-ons Repeater Field ACF nested repeater fields

Helping

ACF nested repeater fields

  • Hi!

    I’m slowly getting to understand ACF and nested repeaters, but I am having trouble displaying it on my site.

    The “Menu Sections” displays, but I must be doing something wrong with the menu items, because it wont display them..

    This is what I have in a code block:

    https://pastebin.com/6Nid7kVd

    Thankful for any tips

  • If you’re using a nested repeater then your second repeater loop needs to be completely within your first repeater loop

    
    if (have_rows('repeater')) {
      while (have_rows('repeater')) {
        // show field from first repeater
        
        // nested repeater
        if (have_rows('nested_repeater')) {
          while (have_rows('nested_repeater')) {
            // show fields from nested repeater
          } // end while nested repeater
        } // end if nested repeater
    
      } // end while repeater
    } // end if repeater
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.