Home Forums Front-end Issues Help with object values within repeater field Reply To: Help with object values within repeater field

  • Hey John,

    Thanks for the advice. I’ve changed my code to the below, and the icon now works, however the loop seems to break after the first record. There should be 3 records, but I’m now only getting one record in the loop. What am I missing or doing wrong?

    <?php if( have_rows('unique_selling_points') ): ?>
    		<div class="wrapper">
    			<div class="usp-list equal-heights">
    				$n = 0;
    				while( have_rows('unique_selling_points') ): the_row();
    					$icon = get_sub_field('icon');
    					$heading = get_sub_field('heading');
    					$intro = get_sub_field('intro');
    					$text = get_sub_field('text');
    					<article class="unit">
    						if ($icon):
    							$post = $icon;
    							<i class="has-circle bg-brand2">
    			                    <svg class="icon-<?php the_field('css'); ?>">
    			                        <use xlink:href="<?php echo get_template_directory_uri(); ?>/images/icons/icons.svg#icon-<?php the_field('css'); ?>"></use>
    						<h1 class="heading4"><?php echo $heading; ?></h1>
    						<p class="intro"><?php echo $intro; ?></p>
    						<?php if( $text ): ?>
    							<div id="usp-<?php echo $n?>" class="reveal">
    								<?php echo $text; ?>
    							<a href="javascript:void(0);" title="Read more" class="btn hover2">
    								Read more
    								<i class="down">
    				                    <svg class="icon-arrow-down">
    				                        <use xlink:href="<?php echo get_template_directory_uri(); ?>/images/icons/icons.svg#icon-arrow-down"></use>
    						<?php endif; ?>
    				<?php endwhile; ?>
    	<?php endif; ?>