Support

Account

Home Forums Add-ons Repeater Field Showing a sub field if it exists Reply To: Showing a sub field if it exists

  • 
    $name = get_sub_field('name');
    if (get_sub_field('link')) {
      ?>
        <a href="<?php the_sub_field('link'); ?>"><?php echo $name; ?></a>
      <?php 
    } else {
      echo $name;
    }