Add Floating WhatsApp Button in your WordPress Website

Open functions.php from your WordPress Child Theme and add the code below:

add_action('wp_footer', 'add_whatsapp_icon');

function add_whatsapp_icon() {
    echo'<a style="display:block;position:fixed;left:15px;bottom:10px;z-index:1000;" href="https://wa.me/918888888888?text=Hi"><img src="https://dwij.net/resources/whatsapp.svg" style="width:50px;height:50px;"></a>';
}

Make sure to update Phone Number.

You may also need to update whatsapp.svg url to support Cross-origin Resource Sharing (CORS). Download SVG file from https://dwij.net/resources/whatsapp.svg.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.