Support

Account

Home Forums Add-ons Repeater Field URL field help Reply To: URL field help

  • Sure, I do this every day – use the “Link” element. It gives you the URL and the Title:

    https://www.advancedcustomfields.com/resources/link/

    <?php 
    $link = get_field('link');
    if( $link ): 
        $link_url = $link['url'];
        $link_title = $link['title'];
        $link_target = $link['target'] ? $link['target'] : '_self';
        ?>
        <a class="button" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?></a>
    <?php endif; ?>