Adding a Facebook share button and Digg this button with tweetmeme retweet button in wordpress thesis theme

I guess the thesis theme is among the most popular wordpress themes among professional bloggers. The best part about the theme is its ability to support custom functions and styles. So virtually everything is possible.

After I tried my hands at Thesis theme for WordPress I added some plugins. I need not explain to you the merits of social media sharing buttons. The hottest in this section are Twitter, Facebook and Digg. Especially the share buttons with the counter are must haves for any blog. You get the code to add these buttons from the official portals. There are plugins to achieve the same. But it’s hard to get all three of them or two of them next to each other using different plugins. The example is right on this post.

If you need to have some thing like this on your blog, then follow this simple guide. I have put in screenshots to help you in process. We will be tinkering around with the coding. So some hands on experience with PHP and HTML is welcome. Else you can follow the coding exactly as it is and hope for the best.

Most popular and accurate Re-Tweet button with count comes from tweetmeme. They have a wordpress plugin for that. I am going to add official Facebook and digg share buttons with share count display to the tweetmeme plugin. In this example I am messing with Thesis wordpress theme. You can do the same to any theme you want. It only changes the code of the plugin so – a theme independent solution.

Browsing to the Tweetmeme.php file in wordpress

Browsing to the Tweetmeme.php file in wordpress

I believe you have a self hosted wordpress blog.

>>So navigate to the wp-content folder.

>> >>Find the plugins folder. Enter

>> >> >>Find the TweetMeme folder. Enter

>> >> >> >> locate this file tweetmeme.php

Now we tinker with the code. To do so, download the file to local system and open is with some standard text editor. I am using dreamweaver. Now look for this function in the code ‘tm_generate_button()’. Use the find feature in your text editor (ctrl +f ) to find this function. The code is rather long so might be hard to do it manually.

Editing the code

Editing the code

The red bordered area is where we do the actual change. You will have something different in the original file. Now add this code to the $button variable so that the final code looks like above.

<br><br><script>var fbShare = {size: \’large\’,google_analytics: \’true\’}</script><script src=””></script>
<script type=”text/javascript”>
digg_url = \”.$url.’\’;digg_title = “TITLE”;

<script src=”” type=”text/javascript”></script> </div>

Replace the file and enjoy. Download this php file right here if it is too much for you.

You can do your own modifications to suit your purpose. Replace the <br> with spaces to get a horizontal effect. Feel free to comment.

More posts you might be interested in: