Share buttons in wordpress without wordpress plugin

I don’t recommend you to use wordpress plugin for adding the share buttons. we have simple code for add Share buttons in wordpress without wordpress plugin

Share buttons in wordpress without wordpress plugin

There are many wordpress plugins available for adding share button in wordpress or any website. I don’t recommend you to use the wordpress plugin for adding the share buttons like, facebook, twitter, linkedin, stumbleupon, delicious and Google buzz. Because when you install wordpress plugin for social buttons then that plugin will use your database and on every page view that will fire query to your database and your page view will became little bit slower. If you are having less visitors then this ok but if your site is having large visitors than you need to think about small issues also. Floating share button are very popular these days. You can easily add the sharebox which floating bar. Using following code you can add the share buttons without wordpress plugin.

I written some code for this and on my site share buttons are looking as follows:

Share buttons in wordpress without wordpress plugin

Share buttons in wordpress without wordpress plugin

I created file called sharebox.php and in that file just written following code.

<div id="sharebox" style="">
<a href="http://twitter.com/share" data-count="vertical" data-via="digcms">
Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js">
</script>
</div>
<div>
<script>var fbShare = {url: <?php the_permalink() ?>,size: 'large',badge_text: 'fff',badge_color: '3b5998',google_analytics: 'true'}</script>
<script src="http://widgets.fbshare.me/files/fbshare.js"></script>
</div><div>
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
</div>
<div><a class='delicious-button'  href='http://delicious.com/save'> <!-- { url:"<?php the_permalink() ?>" ,title:"<?php the_title() ?>" } --> Save on Delicious</a></div><div style="display:none;">

<script type="text/javascript">(function() {var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];s.type = 'text/javascript';s.async = true;s.src = 'http://widgets.digg.com/buttons.js';s1.parentNode.insertBefore(s, s1);})();</script><a></a>

</div>

<div><a title="Post on Google Buzz" href="http://www.google.com/buzz/post" data-button-style="normal-count"></a>
<script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script>

</div><div><script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
<script type="in/share" data-counter="top"></script></div></div>

After creating sharebox.php file, open your single.php file and put following code in that file.

<?php include 'sharebox.php'; ?>

After that open your style.css file and put following code in that file.

#sharebox{display: block;margin-left: -85px;
position: fixed;top:105px;width:65px;
border:#ccc 1px solid;padding:2px}

If you need more buttons then you should prefer following article. In this article you will find the all the share button code. and you dont need to add any wordpress plugin for adding share or like buttons in wordpress site.

Please write comment for our article: Share buttons in wordpress without wordpress plugin

Add the social Bookmark Icons in WordPress theme without plugins

7 Comments

Add a Comment

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