0
votes

So I working on a wordpress site with the FoundationPress Theme and I recently upgraded ACF to the Pro version which allows for the repeater field. So I'm trying to allow the client to add new social media accounts with the repeater.

http://imgur.com/FT58SpD

http://imgur.com/MydpAwl

Above you can see how the repeater is set up on the backend.

Header.php:

<div class="medium-3 columns">
  <?php
    if (have_rows('social_media')):
      while(have_rows('social_media')):the_row();

        $link = get_sub_field('social_media_link'); ?>
        <a href="<?php echo $link; ?>" />
      <?php endwhile;
    endif;
  ?>
</div>

Nothing is outputted into the HTML.

Let me know if I left out any information

1
Also I should mention that this is what I'm following: advancedcustomfields.com/resources/repeater - rikuto148

1 Answers

1
votes

The options page requires an additional value in the field code (see https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/).

  <div class="medium-3 columns">
  <?php
    if (have_rows('social_media', 'option')):
      while(have_rows('social_media', 'option')):the_row();

        $link = get_sub_field('social_media_link'); ?>
        <a href="<?php echo $link; ?>" />
      <?php endwhile;
    endif;
  ?>
</div>