Support

Account

Home Forums Add-ons Repeater Field loop to display all subfield of a repeater Reply To: loop to display all subfield of a repeater

  • thanks 🙂 it’s working

    the final code:

    
     while ( have_rows('reseaux-sociaux', 'option') ) : the_row(); 
    		   	 echo '<ul>';
    					foreach ($fields as $sub_field) {	
    						$field = get_sub_field_object($sub_field);
    						$lien = $field['value'];
    						$image =  $field['label'];
    						if ($field['value']){
    						echo '<li><a href="'.$lien.'" target="_blank"><img src="'.get_stylesheet_directory_uri().' /imgs/icons/social/rondes/pleines/' . $image. '-icon.svg"></a></li>';
    						}			
    					}
    				echo '</ul>';
           endwhile;