Support

Account

Home Forums Add-ons Repeater Field Hiding URL linking in repeater Reply To: Hiding URL linking in repeater

  • I’d do it something like this.

    
    <?php if( have_rows('people') ): ?>
       <?php while( have_rows('people') ): the_row(); 
          // vars
          $person = get_sub_field('person');
          $person_url = get_sub_field('person_url');
          if ($person_url) {
             $person = '<a href="'.$person_url.'">'.$person.'</a>';
          }
       ?>
          <span class="person">
                <?php echo $person; ?>
          </span>
       <?php endwhile; ?>
    <?php endif; ?>