Support

Account

Home Forums Front-end Issues Count total number of post objects Reply To: Count total number of post objects

  • I removed that thanks, but still no change;

    <?php 
        $count = count( get_sub_field('featured_developments') );
        echo '<strong>The total is '. $count . '</strong></br><br>';
    	if( have_rows('featured_developments') == 1 ) {
    ?>
    	<?php while( have_rows('featured_developments') ): the_row(); ?>    
    	<?php
    	    $post_id = get_sub_field('development', false, false);
    	?>
    		<div class="lg-col-12">
    		</div>   
    	<?php endwhile; ?>
    <?php
    	} elseif( have_rows('featured_developments') == 2 ) {
    ?>
    	<?php while( have_rows('featured_developments') ): the_row(); ?>    
    	<?php
    	    $post_id = get_sub_field('development', false, false);
    	?>
    		<div class="lg-col-6 md-col-6">
    		</div>   
    	<?php endwhile; ?>
    <?php
    	} else{
    ?>
    	<?php while( have_rows('featured_developments') ): the_row(); ?>    
    	<?php
    	    $post_id = get_sub_field('development', false, false);
    	?>
    		<div class="lg-col-4 md-col-4">
    		</div>  
    	<?php endwhile; ?>
    <?php
    	}
    ?>    
    <?php wp_reset_query(); ?>