Support

Account

Home Forums Add-ons Flexible Content Field Loop with Counter for Flexible Content Field Sub Field Output Reply To: Loop with Counter for Flexible Content Field Sub Field Output

  • Hi @Brian Larson

    Thanks for the explanation, I see what you are trying to do. Perhaps this is what you are after:

    
    <?php if(get_row_layout() == '3_column_layout'): 
    	
    	// vars
    	$max = 3;
    	
    	?>
    	<div class="row">
    		
    		<?php for( $i = 1; $i <= $max; $i++ ); ?>
    		<div class="small-12 large-4 columns">
    			<dl>
    				<dt><?php the_sub_field("cb_{$max}_col_{$i}_header"); ?></dt>
    				<dd><?php the_sub_field("cb_{$max}_col_{$i}_copy"); ?></dd>
    				<dd><?php the_sub_field("cb_{$max}_col_{$i}_link"); ?></dd>
    			</dl>
    		</div>
    		<?php endfor; ?>
    		
    	</div>
    
    <?php endif; ?>
    

    Untested, but should work