Support

Account

Home Forums Add-ons Repeater Field Hide subfield if it has no text Reply To: Hide subfield if it has no text

  • Just check if the field is populated with PHP:

    
    <div class="pricelist"><?php $rows = get_field('price_list');
    if($rows)
    {
    	echo '<ul class="leaders">';
     
    	foreach($rows as $row)
    	{
    		echo '<li><span class="service">' . $row['product_or_service'] . '</span> <span class="price"> ' . $row['price'] .'</span></li>';
    		if( $row['description']) echo '<p class="description"> ' . $row['description'] .'</p>';
    	}
     
    	echo '</ul>';
    } ?>
    </div>