Official Social Share Button Script

Adding official social share buttons and icons to website using script no plugin needed use without any core file change. Recently when I made changes into website just learn little bit more about this so I’m posting these code which should work on any kind of website platform then may be it’s a WordPress, Magento,  blogger or simple HTML based means on approximately all on web based platform.

Official Social Share Button Script

For Facebook Like Button With Count

<div id="fb-root"></div>
<script>(function(d, s, id) {
 var js, fjs = d.getElementsByTagName(s)[0];
 if (d.getElementById(id)) return;
 js = d.createElement(s); = id;
 js.src = "//";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-share-button" data-type="button_count" data-height="26px"></div>

Google Plus Button With Count

<div class="g-plusone" data-size="medium"></div>
<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
 po.src = '';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);

Twitter Button With Count

<a href="" class="twitter-share-button">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);;js.src="//";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

LinkedIn Button With Count

<script src="//" type="text/javascript">
 lang: en_US
<script type="IN/Share" data-counter="right"></script>

Pinterest Button With Count

<a href="//" data-pin-do="buttonBookmark" ><img src="//" /></a><script type="text/javascript" src="//"></script>

These button share your current page URL to social media website you can change associated image to these social media as well. Currently I’m including current page link script for WordPress read our post how to generate current page URL in different website script. You just need to change <?php esc_url(the_permalink()); ?> with your own code in below code.

 <ul class="sideshare">
 <li class="fb"><a href="<?php esc_url(the_permalink()); ?>"><i class="fa fa-facebook"></i></a></li>
 <li class="tw"><a href="<?php esc_url(the_permalink()); ?>"><i class="fa fa-twitter"></i></a></li>
 <li class="gp"><a href="<?php esc_url(the_permalink()); ?>"><i class="fa fa-google-plus"></i></a></li>
 <li class="li"><a href="<?php esc_url(the_permalink()); ?>"><i class="fa fa-linkedin"></i></a></li>


If you have more codes or need help please comment in below comment section and found this helpful then subscribe to our blog.

3 thoughts on “Official Social Share Button Script

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *