-2

So, here is my code in the order-detail.php file:

 <li>
   <span><?php _e( 'Email:', 'dokan' ); ?></span>
   <?php echo esc_html( get_post_meta( $order->id, '_billing_email', true ) ); ?>
 </li>
 <li>
   <span><?php _e( 'Phone:', 'dokan' ); ?></span>
   <?php echo esc_html( get_post_meta( $order->id, '_billing_phone', true ) ); ?>
 </li>

How would I make this clickable for both phone and email?

Thanks

closed as off-topic by Pieter Goosen, TheDeadMedic, cybmeta, Mayeenul Islam, Robert hue Feb 21 '15 at 5:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

This is really a vanilla PHP/HTML question, but for what it's worth:

<?php if ( $email = get_post_meta( $order->id, '_billing_email', true ) ) : ?>

    <li>
        <span><?php _e( 'Email:', 'dokan' ); ?></span>
        <a href="mailto:<?php echo esc_attr( $email ) ?>"><?php echo esc_html( $email ) ?></a>
    </li>

<?php endif ?>

<?php if ( $phone = get_post_meta( $order->id, '_billing_phone', true ) ) : ?>

    <li>
        <span><?php _e( 'Phone:', 'dokan' ) ?></span>
        <a href="tel:<?php echo esc_attr( $phone ) ?>"><?php echo esc_html( $phone ) ?></a>
    </li>

<?php endif ?>

Not the answer you're looking for? Browse other questions tagged or ask your own question.