Support

Account

Home Forums General Issues while ( have_rows() ) within while ( have_rows() ) Reply To: while ( have_rows() ) within while ( have_rows() )

  • You’ve got the answer, you can’t.

    To do this you really need to forget about using the ACF have_rows() loops and instead get the contents of the repeater and use the array it returns

    
    // return all the contents of the repeater in a nested array
    $slides = get_field('slide');
    
    // loop over array
    if ($slides) {
      foreach ($slides as $slide) {
        // output information from this slide
        foreach ($slides as $inner) {
          // output nested slide information
        } // end nested foreach
      } // end outer foreach
    }