Some of you might ask why create a share to whatsapp link if you can use the native sharing features on your mobile to share a web page. Well from my personal experience, the native sharing to Whatsapp on Android as well as BlackBerry 10 sometimes doesn’t include the title of the web page you wish to share.
Including direct link to Whatsapp just like you have for twitter, Facebook, Google + etc makes the sharing process easier for web users.
If you wish to implement it on your wordpress site (mobile site version makes more sense though some might be browsing your site in desktop mode on tablet), simply add the code below to wherever you want the link to appear in your wordpress theme template.
<a href=”whatsapp://send?text=<?php the_title(); ?>: <?php the_permalink(); ?>” data-action=”share/whatsapp/share”>Whatsapp</a>
Save the template and preview to make sure it’s working right. It should output both the title and link of the web page
This works on Android and BlackBerry 10. I tried it on Windows Phone without success and I don’t have an iOS device so it might or might not work for web users on that mobile platform.
Feel free to test it out with the whatsapp share link on this site ;-)
Discover more from Patchwork Of Tips
Subscribe to get the latest posts sent to your email.
You’ll also like:
Please share this article to help others. Thanks