Support

Account

Forum Replies Created

  • Another follow up with a solution, hopefully this helps someone – the first “while” was producing an infinite loop: <?php while ( have_posts() ) : the_post(); ?>

    Once that was removed I managed to make this working, here’s the full code:

    <?php
    
    $i = 0;
    ?>
    
    <div id="team" class="d-none d-md-block m-t-90 p-b-100 border-bee border-bee-vertical border-bee--gray border-bee--left"></div>
    	<div class="container">
    			<?php
    			// check for rows (parent repeater)
    			if( have_rows('about_team_sections') ): ?>
    				<?php
    				// loop through rows (parent repeater)
    				while( have_rows('about_team_sections') ): the_row(); ?>
    					<div class="row team-row">
    						<?php
    						// check for rows (sub repeater)
    						if( have_rows('team_section') ): ?>
    							<?php
    							// loop through rows (sub repeater)
    							while( have_rows('team_section') ): the_row();
    								// display columns
    								?>
    								<div class="col-md-4 ab-team-item">
    									<div class="ab-team text-center" data-id="<?=$i?>" data-scroll-animate="fadeIn">
    										<div class="ab-team-image">
    											<img src="<?=\AB\Template\get_image_url(get_sub_field('image'))?>" alt="">
    										</div>
    										<div class="ab-team-content">
    											<div class="ab-team-name font-windsor-bold fs-21"><?=get_sub_field('name')?></div>
    											<div class="ab-team-position text-uppercase fs-12 letter-spacing-200"><b><?=get_sub_field('position')?></b></div>
    											<div class="ab-team-social-media">
    												<ul>
    													<?=get_sub_field('social_media')?>
    												</ul>
    											</div>
    										</div>
    									</div>
    								</div><!-- end .ab-team-item -->
    							<?php endwhile; ?>
    						<?php endif; //if( get_sub_field('team_section') ): ?>
    					</div>
    				<?php endwhile; // while( has_sub_field('about_team_sections') ): ?>
    			<?php endif; // if( get_field('about_team_sections') ): ?>
    	</div><!-- end .container -->
    
  • Following up – I decided to use nested repeater approach for this, however it’s producing an endless loop for the following code:

    <?php
    
    $team = get_sub_field('team_section');
    
    ?>
    
    <div id="team" class="d-none d-md-block m-t-90 p-b-100 border-bee border-bee-vertical border-bee--gray border-bee--left"></div>
    	<div class="container">
    
    		<?php while ( have_posts() ) : the_post(); ?>
    
    			<?php
    
    			// check for rows (parent repeater)
    			if( have_rows('about_team_sections') ): ?>
    				<div id="team">
    				<?php
    				// loop through rows (parent repeater)
    				while( have_rows('about_team_sections') ): the_row(); ?>
    					<div class="row team-row">
    						<?php
    						// check for rows (sub repeater)
    						if( have_rows('team_section') ): ?>
    
    							<?php
    							// loop through rows (sub repeater)
    							while( have_rows('team_section') ): the_row();
    
    								// display columns
    								?>
    
    								<div class="col-md-4 ab-team-item">
    									<div class="ab-team text-center" data-id="<?=$i?>" data-scroll-animate="fadeIn">
    										<div class="ab-team-image">
    											<img src="<?=\AB\Template\get_image_url($team['image'])?>" alt="">
    										</div>
    										<div class="ab-team-content">
    											<div class="ab-team-name font-windsor-bold fs-21"><?=$team['name']?></div>
    											<div class="ab-team-position text-uppercase fs-12 letter-spacing-200"><b><?=$team['position']?></b></div>
    											<div class="ab-team-social-media">
    												<ul>
    													<?=$team['social_media']?>
    												</ul>
    											</div>
    										</div>
    									</div>
    								</div>
    
    							<?php endwhile; ?>
    
    						<?php endif; //if( get_sub_field('team_section') ): ?>
    					</div>
    
    				<?php endwhile; // while( has_sub_field('about_team_sections') ): ?>
    				</div>
    			<?php endif; // if( get_field('about_team_sections') ): ?>
    
    		<?php endwhile; // end of the loop. ?>
    	</div><!-- end .container -->
    
Viewing 2 posts - 1 through 2 (of 2 total)