Support

Account

Home Forums Add-ons Repeater Field True false in repeater Reply To: True false in repeater

  • You can’t use get_sub_field() unless you are in a have_rows() loop. https://www.advancedcustomfields.com/resources/have_rows/

    This will return an array of rows

    
    $seite = get_field('seite');
    

    where each element of the array is a row with nested elements for each field
    example representation of this value:

    
    $seite = array(
      array(
        // row 1
        'zusatzbutton-check' => 1, / some value for this sub field
        'second-sub-field' => 'value of this field',
        // etc... 
      ),
      array(
        // row 2
        // etc...
      )
    )
    

    Have rows loop

    
    if (have_rows('seite')) {
      while (have_rows('seite')) {
        the_row();
        if (get_sub_field('zusatzbutton-check')) {
          // show information about this row
          // for more information see the link provided for have_rows()
        }
      }
    }