How to create a “Share This Post” section beneath posts
Blogging is sharing and thanks to many native Wordpress plugins as well as handy code snippets, we can make it easier for readers to bump, tweet, digg, or save our blog posts. The easier, the better the chances for some social love. The following article will take you trough the steps to create a small “Share this Post” section after your blog post, easy enough for non-programmers to follow.
The easy way
If you don’t want to code at all but use a WP plugin that does all the work for you, I recommend Sociable. It’s available for Wordpress, Blogger and plain simple HTML sites. You simply pick the services that interest you and choose from the many settings available. Activate the plugin and your readers can start to share your content instantly.


![]()
You can easily style the appearance of the Sociable bar through CSS. I found it quite handy and easy to implement. But what if some of the services you like are not supported by Sociable? Then it comes down to creating sharing buttons manually. Fear not, it’s easy enough, even if you are like me more a designer than a coder.
Creating share buttons
First and foremost, you should think about which services you want to provide buttons for. Your needs will vary, depending on the kind of content you publish. For designers and developers, DesignBump will be almost unavoidable, while Delicious, Facebook and Twitter shouldn’t be absent on any blog. Be aware though, that most of these services can only be used with an existing account (by you and the user promoting your post).
Before you start hunting the web for nice buttons, check out the official pages of your services first. Many offer ready made badges and source code to implement. Look in the “Tools” sections.

Using the code provided by the sites often includes icons. On the iKreateIt blog I use the icons that were provided, save the Delicious icon because it was too small to fit with the others. Here are some sample code snippets for you to use:
<script type="text/javascript"><!--mce:0--></script> <script src="http://designbump.com/sites/all/modules/drigg_external/js/button.js" type="text/javascript"><!--mce:1--></script>
<script src="http://cypherbox.net/evb/button.php" type="text/javascript"><!--mce:2--></script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"><!--mce:3--></script>
Retweet Button I actually cheated a little bit here. You can insert a badge manually, but since Tweetmeme offers a nice WP plugin that you can customize nicely, I installed the plugin and then called the badge with a short function — that means the code below WORKS ONLY with the WP plugin installed!
<?php if (function_exists('tweetmeme')) echo tweetmeme();?>
Delicious Amazingly enough, I found it rather difficult to get the Delicious button to work. The icon provided by Delicious was, as mentioned before, too small for my taste and I wanted to use one of my own. It took me a while to find a code snipped that allowed me that (I probably shouldn’t code anymore after 11pm). This finally worked for me:
<a href="javascript:location.href='http://del.icio.us/post?v=2&url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title)+' '"><img src="http://ikreateit.com/wp-content/themes/twicet/images/delicious.png" alt="delicious" width="64" height="64" /></a>
Obviously, you need to replace the image location with something on your own server.
Facebook If you are looking for a simple and small Facebook button, you can use this code. It will display only a tiny Facebook symbol, the word ‘share’ and a share count:
<a name="fb_share"></a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"><!--mce:4--></script>
Otherwise, if you are like me and like the big Facebook button, grab the Facebook plugin, set the location setting to “Manual” in the options panel and call it with this function:
<?php echo facebook_sharecount();?>
Oh no, I am confused!
Don’t sweat it. Those were just some code samples for readers who are looking for something in particular. If your goal is to create a section like mine below, have a look at this code. I’ll explain beneath the snippet.
<div id="socialkudos">
<h2>Sharing is lovin'!</h2>
<!-- DESIGNBUMP -->
<span class="socialmedia"><script type="text/javascript">url_site='<?php the_permalink(); ?>'; </script> <script src="http://designbump.com/sites/all/modules/drigg_external/js/button.js" type="text/javascript"></script></span>
<!-- RETWEET -->
<span class="socialmedia"><?php if (function_exists('tweetmeme')) echo tweetmeme();?></span>
<!-- FACEBOOK -->
<span class="socialmedia"><?php echo facebook_sharecount();?></span>
<!-- CYPHERBOX -->
<span class="socialmedia"><script type="text/javascript" src="http://cypherbox.net/evb/button.php"></script></span>
<!-- DELICIOUS -->
<span class="socialmedia"><a href="javascript:location.href='http://del.icio.us/post?v=2&url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title)+' '"><img src="http://ikreateit.com/wp-content/themes/twicet/images/delicious.png" alt="delicious" width="64" height="64"/></a></span>
</div><!-- end socialkudos -->
To make sure this appears beneath every blog post, you need to edit your single.php file. Put the above code somewhere before the end of the content loop (the loop that makes sure your posts are published if there are any). In non-tech babble, place it somewhere between these lines:
<?php if (have_posts()) : while (have_posts()) : the_post(); /*there can be a lot of code here*/ <?php endwhile; else: ?>
I wrapped my sharing section in a DIV with the ID ‘socialkudos’ (I know, terribly original). That is because I wanted to control the placement and styling of the box with CSS (scroll down to see the styles that I applied). Inside the DIV, I simply placed the code snippets and wrapped them in a SPAN to float them to the left and thereby arranging them next to each other.
#socialkudos {
width: 480px;
height: 120px;
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
padding: 20px;
border: 1px solid #dcdcdc;
background: #f1efef;
}
#socialkudos h2 {
font-size: 15px;
font-weight: bold;
}
.socialmedia {
float: left;
padding-right: 10px;
}
And that’s it! Now you can create a sharing section in your own blog and see how your readers spread the word. Speaking of which: enjoyed reading this or found a solution to a problem? I’d appreciate your social love too

Nice tutorial, extremely useful for non wordpress users or wp users that have a few sharing buttons but need a few more
Hey, thanks for stopping by and commenting. I appreciate it!
Found this post from McBonio’s one! Really like it, both sites being added to my reader now!
How to easily create a sharing section for social networks beneath Wordpress posts…
The following article will take you trough the steps to create a small Share this Post section after your blog post, easy enough for non-programmers to follow.…
I’ve been looking for a tutorial like this for a couple of days now.. Gonna have to find the php code for the compact versions though… I’ll try this later