Support

Account

Home Forums Add-ons Repeater Field Checkboxes repeater display value label

Unread

Checkboxes repeater display value label

  • Hello

    I’m trying to display checkboxes fields with label and values. It’s checkbox from repeater.
    I tried with “get_sub_field_object”. This is my code:

    if( have_rows('patrick', 'user_2') ): 
    while ( have_rows('patrick', 'user_2') ) : the_row();
    	
    	// vars			 
    			$interventions = get_sub_field_object('interventions');
    			$value = $interventions['value']; // values
    			$label = $interventions['label']; // labels		 
    	foreach ($interventions as $intervention): 
    ?>
    
    	<div class="blockLien">
    		<span class="cercle colo<?php echo $label; ?>"><span class="<?php echo $label; ?>-icon"></span></span>
    			<a href="" class="coloTxt<?php echo $label; ?> <?php echo $label; ?>">
    				<span class="color-<?php echo $label; ?>"><?php echo $value; ?></span>
    				
    				<span></span>
    			</a>
    		</div>
    
    	<?php 
    	endforeach;
    	endwhile;
    endif;	?>

    But this is displaying “Array” repeating in infinite loop (I just have 4 elements maximum)

Viewing 1 post (of 1 total)

The topic ‘Checkboxes repeater display value label’ is closed to new replies.