admin管理员组文章数量:1415119
Can someone explain how I would rewrite this bit of code to include a tel: clickable phone number and make the email address clickable to info:hi
I am having a bit of trouble with this.
<address class="address_phone">
<span class="icon icon-phone"></span>
<div class="contact_title"><?php echo esc_html__('Phone:', 'yogastudio') ?></div>
<span class="contact_item phone"><?php if (!empty($phone)) echo esc_html($phone); ?></span>
</address></div><div class="column-1_3">
<address class="address_email">
<span class="icon icon-mail"></span>
<div class="contact_title"><?php echo esc_html__('Email:', 'yogastudio') ?></div>
<span class="contact_item mail"><?php if (!empty($email)) echo esc_html($email); ?></span>
</address></div>
Can someone explain how I would rewrite this bit of code to include a tel: clickable phone number and make the email address clickable to info:hi
I am having a bit of trouble with this.
<address class="address_phone">
<span class="icon icon-phone"></span>
<div class="contact_title"><?php echo esc_html__('Phone:', 'yogastudio') ?></div>
<span class="contact_item phone"><?php if (!empty($phone)) echo esc_html($phone); ?></span>
</address></div><div class="column-1_3">
<address class="address_email">
<span class="icon icon-mail"></span>
<div class="contact_title"><?php echo esc_html__('Email:', 'yogastudio') ?></div>
<span class="contact_item mail"><?php if (!empty($email)) echo esc_html($email); ?></span>
</address></div>
Share
Improve this question
asked Aug 30, 2019 at 13:45
user3504751user3504751
132 bronze badges
2 Answers
Reset to default 0Please edit your code as below:
<address class="address_phone">
<span class="icon icon-phone"></span>
<div class="contact_title"><?php echo esc_html__('Phone:', 'yogastudio') ?></div>
<span class="contact_item phone">
<?php if (!empty($phone)) { echo '<a href="tel:'.$phone.'">'.esc_html($phone).'</a>';} ?>
</span>
</address></div><div class="column-1_3">
<address class="address_email">
<span class="icon icon-mail"></span>
<div class="contact_title"><?php echo esc_html__('Email:', 'yogastudio') ?></div>
<span class="contact_item mail"><?php if (!empty($email)) { echo '<a href="mailto:'.$email.'">'.esc_html($email).'</a>';}?></span>
</address></div>
Remove.
<?php if (!empty($phone)) { echo '<a href="tel:'.$phone.'">'.esc_html($phone).'</a>';} ?>
Replace with
<a href="tel:+4401234567895">Call us</a>
Note you should include the International dial code as well.
For the email, replace
<?php if (!empty($email)) { echo '<a href="mailto:'.$email.'">'.esc_html($email).'</a>';}?>
With:
<a href="mailto:[email protected]">Email us</a>
本文标签: putting Mailto and Tel into footerphp code wordpress
版权声明:本文标题:putting Mailto: and Tel: into footer.php code wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745198819a2647271.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论