Last Updated:
Social Media Sharing Plugin for Every Blogger Post

Social Media Sharing Plugin for Every Blogger Post

Today’s post also related to Search Engine Optimization and in this post I will share plugin which help you to engage your Blog with top rated Social Media networks. Right after installation, below your Blogger post you will see there social media sharing plugin i.e Facebook, Twitter, Pinterest etc. to share your contents across the top rated social media platforms. This plugin also help you to know better result to find how much coming visitors love and share your shared contents.

Most Recenet Shared Articles:-

Social Media Sharing Plugin for Every Blogger Post

Here below you will find the code for this useful plugin to share your Blogging experience amongst social media platforms. Follow the given below instructions.

Go to Blogger Dashboard >> Layout >>

Add a Gadget and Select the HTML/JavaScript Gadget

Now copy the given below code and paste in the HTML/JavaScript Gadget

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-523e83c314ba1932"></script>
<script type='text/javascript'>
var addthis_product = "blg";
document.doAT = function(cl)
{
        var myclass = new RegExp('hentry');
        var myTitleContainer = new RegExp('post-title');
        var myPostContent = new RegExp('post-footer');
        var elem = this.getElementsByTagName('div');
        var url;
        var title = "";
        for (var i = 0; i < elem.length; i++)
        {
            var classes = elem[i].className;
            if (myclass.test(classes))
            {  
                var container = elem[i];
                url = window.location.href;
                for (var b = 0; b < container.childNodes.length; b++)
                {
                    var item = container.childNodes[b].className;
                    if (myTitleContainer.test(item))
                    {
                        var link = container.childNodes[b].getElementsByTagName('a');
                        if (typeof(link[0]) != 'undefined')
                        {
                            var url = link[0].href;
                            var title = link[0].innerHTML;
                        }
                    var singleq = new RegExp("'", 'g');
                    var doubleq = new RegExp('"', 'g');                                                                                                                                                                                                                       
                    title = title.replace(singleq, '&#39;', 'gi');
                    title = title.replace(doubleq, '&#34;', 'gi');
                    }
                    if (myPostContent.test(item))
                    {
                        var footer = container.childNodes[b];
                    }
                }
                    var n = document.createElement('div');
                    var at = "<div class='addthis_toolbox addthis_default_style ' addthis:title='"+title+"' addthis:url='"+encodeURI(url)+"'   > <a class='addthis_button_facebook_like' fb:like:layout='button_count'></a> <a class='addthis_button_tweet'></a> <a class='addthis_button_pinterest_pinit'></a> <a class='addthis_counter addthis_pill_style'></a> </div> ";
                    n.innerHTML = at;
                    container.insertBefore(n , footer);  
            }
        }
    return true;
};
document.doAT('hentry');
</script>

Save your template and checkout your Blogger post.

Read :- Best Ways to Drive More Traffic to Your Blog

Bottom Lines:-

Its very necessary to share your contents and engage to social media networks always. Its help you to drive more traffic to your Blog and increase ways to earn more money from your Blogging niche.

Comments