Support

Account

Home Forums ACF PRO Only show containing div if sub field has content in Reply To: Only show containing div if sub field has content in

  • 
    <div class="main-content">
    
    <?php if( have_rows('section_about_yoga') ): ?>
    <?php
    // loop through rows (parent repeater)
    while( have_rows('section_about_yoga') ): the_row(); ?>
    <div class="yoga-section clearfix">
    <div class="col-md-7 margr"><?php the_sub_field('text_about_yoga'); ?></div>
    <div class="col-md-5 sidebar">
    <?php 
    	if (get_field('sidebar_yoga_info')) {
    		?>
    			<div class="bordered-box"><?php the_sub_field('sidebar_yoga_info'); ?></div>
    		<?php 
    	}
    ?>
    </div>
    </div>
    
    <?php endwhile; ?>
    
    <?php endif; ?>
    
    </div>