Hii,
it is possible, but how to do that depends on where you would like to add this button exactly? Inside the “Show Contact Information” box, next to the contact form button or somewhere else?
Hi Greg
Yes Inside the “Show Contact Information” box
Hi,
ok, to do that you would need to add the below code in your theme functions.php file
add_action( "adverts_tpl_single_bottom", function() {
remove_action( "adverts_tpl_single_bottom", "adverts_single_contact_information_box", 2000 );
add_action( "adverts_tpl_single_bottom", "my_adverts_single_contact_information_box", 2000 );
}, 100 );
function my_adverts_single_contact_information_box( $post_id ) {
?>
<div class="adverts-contact-box adverts-contact-box-toggle">
<p class="adverts-contact-method">
<span class="adverts-icon-phone adverts-contact-icon" title="<?php _e("Phone", "adverts") ?>"></span>
<span class="adverts-contact-phone"></span>
</p>
<p class="adverts-contact-method">
<span class="adverts-icon-mail-alt adverts-contact-icon" title="<?php _e("Email", "adverts") ?>"></span>
<span class="adverts-contact-email"></span>
</p>
<p class="adverts-contact-method">
<span class="adverts-icon-whatsapp adverts-contact-icon" title="<?php _e("WhatsApp", "adverts") ?>"></span>
<span class="adverts-contact-whatapp"><?php echo esc_html( get_post_meta( $post_id, "whatsapp", true ) ) ?></span>
</p>
</div>
<?php
}
I understand that the whatsapp number you are storing in the [adverts_add] form as a custom field so in the above code in the line get_post_meta( $post_id, "whatsapp", true ) you would need to replace “whatsapp” with the actual field name which stores the number.
Please note that while the email and phone number are loaded via AJAX (so are somewhat protected from harvester collecting contact details) the WhatsApp is always shown on page, although i am not sure if the WhatsApp numbers are used for sending spam.