There are several plugins that insert buttons to retweet and like into a post. You can see the count of retweets and likes at the top of single blog posts.

What I want to do is show the retweets and likes in the blog home page, which has excerpts and thumbnails

Like this

Fabuous Post Title Retweet (button) - 45 18 likes


There must be a way to edit functions.php for this but I don't know what to do.

How is this done?


Examples of desired display: http://epiclaunch.com/ http://wptricks.net/

3 Answers 3


Here is a short and simple plugin I wrote to add a re-tweet and Facebook like button to each post. This version of the Facebook like button uses the newer XFBML instead of the iframes but requires you to register an app id.

To use the buttons just add the function call to your loop.

Plugin Name: C3M Social Share Buttons
Plugin URI: http://c3mdigital.com/
Description: Adds Facebook and Twitter Share Buttons using template tags
Version: 1.0
Author: Chris Olbekson
Author URI: http://c3mdigital.com

// Social Share Buttons by Chris Olbekson.  This Plugin is Licensed under The GPL v2 and my be freely distributed.  This plugin will not work without entering a valid Facebook app id registered to the domain it is being used on.

//This adds the Facebook and Twitter js to your foooter hooking into wp_footer
function c3m_share_this_scripts() {

        echo '<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
        echo '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>';
        echo  '<div id="fb-root"></div>';
        echo    '               <script>';
        echo        "               window.fbAsyncInit = function() {;
                        FB.init({appId: 'xxxxxxxxxxxxxxx', status: true, cookie: true,
                                xfbml: true});
        echo        "                 (function() {
                                    var e = document.createElement('script'); e.async = true;
                                    e.src = document.location.protocol +


    add_action('wp_footer', 'c3m_share_this_scripts' );

    function c3m_social_share() {

                echo '<div class="social-share" style="margin-bottom:50px;width:500px;">
                    <ul class="share-buttons">
<li style="float:left;margin-right:25px;"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'; echo the_permalink(); echo '" data-text="'; echo the_title(); echo '" data-count="horizontal" data-via="your_twitter_username">Tweet</a></li>
                    <li style="float:left;width:300px"><fb:like href="'; echo the_permalink(); echo'" layout="standard" action="like" font="lucida grande"></fb:like></li>';

                echo '</ul>
                     </div><div class="clear"> </div>'; 



While you could edit your theme, it seems that Wptricks.net is using the WP Socializer plugin.



I realize this is an old question, but I wanted to point out wptricks.net's retweet button is actually from the Tweetmeme plugin, not the Socializer plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.