Support

Account

Home Forums Add-ons Repeater Field Conditional Statements Using Repeater: if… else Reply To: Conditional Statements Using Repeater: if… else

  • Hi @gd6d

    No worries. Your code would look something like this:

    
    <?php
     
    $rows = get_field('bloc_service_internet');
    if($rows)
    {
    	foreach($rows as $row)
    	{
    		echo '<div class="box gris-clair"><div class="twocol-one"><h3>' . $row['titre_service_internet'] . '</h3><p>' . $row['texte_service_internet'] . '</p><div class="box contact">' . $row['bloc_en_savoir_plus'] . '</div></div><div class="twocol-one last">';
    
    		if( $row['image_service_internet']) 
    		{
    			echo '<img src="' . $row['image_service_internet'] .'"></div><div class="fix"></div></div><div class="woo-sc-divider"></div>';
    		}
    		else
    		{
    			// echo video
    		}
    	}
    }
     
    ?>