Support

Account

Home Forums Add-ons Repeater Field Link to External URLs? Reply To: Link to External URLs?

  • Hi @wpdragon

    This is called a conditional statement:

    
    <?php 
    
    $url = get_field('photographer_url');
    
    ?>
    <p class="image_photographer">Image courtesy of: <?php if( $url ): ?><a href="<?php echo $url; ?>"><?php endif; ?> <?php the_field('image_photographer') ?> <?php if( $url ): ?></a><?php endif; ?></p>