Support

Account

Home Forums ACF PRO How to make Email and Mobile Number Clickable

Solved

How to make Email and Mobile Number Clickable

  • Hi

    How do you make email and mobile number clickable? I am using oxygen builder.

    The php i am using so far is like this which works fine just not clickable.

    <?php
    $language = get_post_meta( get_the_ID(), ‘language’, true );
    $email = get_post_meta( get_the_ID(), ’email’, true );
    $phone = get_post_meta( get_the_ID(), ‘phone’, true );

    if ( $language ) {
    echo ‘Languages: ‘ . $language . ‘<br/>’;
    }

    if ( $email ) {
    echo ‘Email: ‘ . $email . ‘<br/>’;
    }

    if ( $phone ) {
    echo ‘Phone: ‘ . $phone . ‘<br/>’;
    }

    ?>

    Many thanks

    Danny

  • 
    if ( $email ) {
      echo 'Email: <a href="mailto:'.$email.'">'.$email.'</a><br/>';
    }
    
    if ( $phone ) {
      echo 'Phone: <a href="tel:'.$phone .'">'.$phone .'</a><br/>';
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.