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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.