Support

Account

Home Forums Add-ons Repeater Field Calling in Custom Fields Reply To: Calling in Custom Fields

  • Sure. I purchased the add-on for “repeater” fields, to make it easier to add several lines of information.

    The initial code above just calls in the field ‘stockists’ (the name of the ACF I created). What I needed to do was call in the ‘repeater_field’ followed by each repeated field. Here’s the correct code..

    <?php while(the_repeater_field('stockists')): ?>
    <div class="stockists"><br />
    	<strong><?php the_sub_field('stockists_name'); ?></strong><br />
    	<?php the_sub_field('address'); ?><br />
    	<?php the_sub_field('address_2'); ?><br />
    	<?php the_sub_field('city'); ?><br />
    	<strong><?php the_sub_field('phone_number'); ?></strong><br />
    	<?php the_sub_field('website'); ?><br />

    So ‘stockists’ was the original custom field. Name, address, city etc are the repeater fields.