Whatsapp share button short script for Blogger
As you all know with time technology is going vast and every 2nd person is having a cell phone in today's era. There should be some facility or script coding, that can help you share any favorable article on whatsapp. This is strange that till now there's no official whatsapp share widget from whatsapp.
Blogger is a well known big platform, i'm sure that every blogger is being searching for detailed tutorial on
How to add whatsapp share button in simple steps
You've credit on your phone or not. Maybe you even forget to take your wallet with you. But whatsapp and wifi will always be there with you. If you own a blog on any niche, you aren't suppose to miss any opportunity to receive traffic.Adding whatsapp share button to your blog
1. Copy below code before
JAVASCRIPT
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'/>
<script>
// Whatsapp share button
$(document).ready(function() {
$(document).on("click", '.tist', function() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
var text = $(this).attr("data-text");
var url = $(this).attr("data-href");
var message = encodeURIComponent(text) + " - " + encodeURIComponent(url);
var whatsapp_url = "whatsapp://send?text=" + message;
window.location.href = whatsapp_url;}
else {alert("This function works on Mobile Device only");}});
});
</script>
2. Search for paste below css code above it.
CSS
/* Whatsapp css setting */
.tist{background:#35BA47; color:#fff; padding:2px 6px; border-radius:3px;}
a.tist:hover{color:#fff !important;}
3. Paste this html code above post footer. And click save!
HTML
<a class='tist' expr:data-href='data:post.url' expr:data-text='data:post.title' href='#'>Share on whatsapp</a>
No comments:
Post a Comment