Support » Plugin: Advanced Custom Fields » How to adding a repeater field in a repeater field

  • Hello,

    have set up a repeater custom field, inside this I would like to add another repeater field.

    The current code I am using is

    			$rows = get_field('membership_option');
    			foreach($rows as $row)
    			 { ?>
    			 <div class="item">
    			<div class="itemLeft">
    			 <h2><?php echo $row['membershipName']; ?></h2>
    			 <p><?php echo $row['description']; ?></p>
    			</div><!-- itemLeft-->
    			<div class="itemCenter">
    /* 2nd REPEATER FIELD HERE ------------------------- */
    			<?php if(get_field('benefitsList')): ?>
    			  <?php while(has_sub_field('benefits')): ?>
    			   <li>sub_field_1 = <?php the_field('benefits'); ?></li>
    			  <?php endwhile; ?>
    			<?php endif; ?>
    /* END 2ND REPEATER FIELD ------------------------------------ */
    			</div><!-- itemCenter -->
    			 <div class="itemRight">
    			  <table class="prices">
    				<td>Direct Debit*</td>
    				<td><?php echo $row['adultDDprice']; ?></td>
    				<td><?php echo $row['adultMonthlyPrice']; ?></td>
    				<td><?php echo $row['adultAnnualPrice']; ?></td>
    				<td>Senior (60+) /<br/> Student</td>
    				<td><?php echo $row['senStuDDprice']; ?></td>
    				<td><?php echo $row['senStuMonthlyPrice']; ?></td>
    				<td><?php echo $row['senStuAnnualPrice']; ?></td>
    			 </div><!-- itemRight-->
    			 } //end for
    			}// endif ?>

    I am wanting to add the 2nd repeater field just after the itemCenter div.

    Any help much appreciated.


  • The topic ‘How to adding a repeater field in a repeater field’ is closed to new replies.