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.
Thanks to both for your help. I was using the_repeater_field and only calling in the_field! Love that moment when the penny drops!
Like this?
<?php while(have_posts()): the_post(); ?>
<p><?php the_field('stockists'); ?></p>
<?php endwhile; ?>
My page displays the header and footer (just under the header) and it says ‘array, array’ where the page and it’s custom fields should be.