1. Find a Whatsapp icon
First of all we need an icon to allow the user to click on. There are many royalty free image sites you can choose from. Download an icon you like, upload it to the media section and put the URL on the side for now.
2. Define the parameters
There are 2 parameters you need to decide:
- The phone number to which you want to send the message Whatsapp
- The message that will be sent to you
3. Put it all together
Here is your button:
Copy the above but be sure to change the phone number and message.
4. Paste the code
For the sake of this tutorial we will place the icon at the bottom left of the screen and give it a fixed position so that you cannot lose it.
So to do this, I'll paste the code from above into mine footer.php
files just before the body
closing tag.
Once I save my file and update my browser, I will be able to see the icon at the bottom of the page. Now we will go ahead and shape it.
5. Draw the Whatsapp button
All you have to do is write a few lines CSS
and paste it into yours style.css
file.
As you can see, I placed my 5 pixel icon from the left of the screen and 65 pixels from the bottom. The reason I did it was the fact that it blocked some text on my footer when I scrolled to the end of my page, but you can play it as you wish.
6. The moment of truth
All you should do now is update the page, make sure you like the place where the icon is located, click on it and make sure you are transferred to Whatsapp to send your message.
Although this tutorial should be incredibly easy to do on your site, if you still need a plug-in, here is a plug-in that will help you implement a Whatsapp click to call button.
Click Chat to chat Whatsapp
This plugin has 10 different design styles and is really easy to use. Here are some other features:
- Choose your icon / image
- animations
- Style on a specific page / post
- Define your message
- Support for Google Analytics and Tag Manger Event
- Support for Facebook events