Cara Memasang Tombol like Facebook, Twitter Tweet, Google+ & Share di Blog

tombol share di blog

Cara Memasang Tombol like Facebook, Twitter Tweet, Google+ & Share di Blog. Ada banyak cara memasang widget share di blog. Untuk tutorial kali ini, saya akan membagikan sebuah trik mudah memasang Tombol like facebook, twitter tweet, google+ & share di blog. Tombol share ini sendiri berfungsi untuk menyebarluaskan artikel kita. Semakin blog kita dipromosi lewat tombol share ini maka semakin popular juga artikel blog kita. Langsung saja ini dia Cara mudah Pasang Tombol like Facebook, Twitter Tweet, Google+ & Share di blog.

– login ke blog anda
– pilih rancangan –> tambah elemen –> pilih HTML/Javascript
– Lalu copy kode berikut ke dalam nya.
<!– AddThis Button BEGIN –>
<script type=”text/javascript” src=”http://s7.addthis.com/js/300/addthis_widget.js”></script&gt;
<script type=’text/javascript’>
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’);
        for (var i = 0; i < elem.length; i++)
        {
            var classes = elem[i].className;
            if (myclass.test(classes))
            {
                var container = elem[i];
                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;
                        }
                        else
                        {
                            var url = document.url;
                            var title =  container.childNodes[b].innerHTML;
                        }
                        if (typeof(url) == ‘undefined’|| url == ‘undefined’ ){
                            url = window.location.href;
                        }
                    var singleq = new RegExp(“‘”, ‘g’);
                    var doubleq = new RegExp(‘”‘, ‘g’);                                                                                                                                                                                                                         
                    title = title.replace(singleq, ‘'’, ‘gi’);
                    title = title.replace(doubleq, ‘"’, ‘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_google_plusone’ g:plusone:size=’medium’></a> <a class=’addthis_counter addthis_pill_style’></a> </div> “;
                n.innerHTML = at;
                container.insertBefore(n , footer);
            }
        }
    return true;
};


document.doAT(‘hentry’);
</script>
<!– AddThis Button END –>


– jangan lupa klik Save.

Hasilnya akan seperti gambar di bawah ini

memasang tombol share di blog

Semoga cara Memasang tombol Share di blog ini dapat bermanfaat buat anda.

About Legy Masyhury

Hanya manusia biasa, sungguh! :D http://legianto.com http://desainku.net http://masyhury.web.id http://ideku.info
This entry was posted in Tutorial Blog. Bookmark the permalink.

5 Responses to Cara Memasang Tombol like Facebook, Twitter Tweet, Google+ & Share di Blog

  1. mantap.. makasih tutorialnya bos

  2. keren gan info'y,makasih banyak yee ..jangan lupa kunjungan balik :Dhttp://ojezzlastfriend.blogspot.com/

  3. Kerenn, Jangan lupa kunjugnihttp://denbo-1.blogspot.com/

  4. thanks bank atas artikelnyaa…krennn…jngan lupa kunjungi nii http://istiqlalf.blogspot.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s