• Hi everyone,
    I ran into an issue with Advanced Custom Fields where an empty container is displaying instead of the “else” statement after the content has been removed from the container. So to be clear it once had information but that information was deleted.

    URL: http://pitweb.pitzer.edu/advancement/faculty-staff-gift-campaign/

    I’m pretty sure my has an error can anyone see my mistake in the php below?

    <?php
    	// check if the accordion repeater field has rows of data
    	if( have_rows('accordion') ): ?>
     	<?php // loop through the rows of data
    	    while ( have_rows('accordion') ) : the_row(); ?>
    		<div class="section-container accordion content" data-section="accordion">
    			<section>
    				<p class="title" data-section-title><strong><a href="#"><?php the_sub_field('accordion_title'); // accordion title acf ?></a></strong></p>
    
    		<div class="content" data-section-content>
    
    			<?php the_sub_field('accordion_content'); // accordion content acf ?>
    
    		</div>
    			</section>
    
    		</div>
    
    		<?php 
    
    	    endwhile;
    
    	else :
    
    	    // no rows found
    
    	endif;
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin: Advanced Custom Fields’ is closed to new replies.