I created custom wordpress theme. In that theme I am using the_excerpt method for showing the post on some pages.
I installed the tweetmeme and facebook-share-new plugins and activated on wordpress site.
I saw one issue with these plugins. These plugins are showing on only single pages or posts.

show tweetmeme button and facebook share button

show tweetmeme button and facebook share button

Facebook and twitter button are not showing when I am using the the_excerpt() function.

I tried google but I did not got any suaitable answer. Everybody is saying about do mannual work when we creating the post.

So did checked the these plugins and I found the solution.

First I am taking about tweetmeme plugin. I opened the “tweetmeme.php” file. This file you will find in wordpress plugins and tweetmeme folder.

Add following code to line no 721 and comment the following line.

add_filter(‘the_excerpt’, ‘tm_update’);
//add_filter(‘get_the_excerpt’, ‘tm_remove_filter’, 9);

Add following code to line no 129
remove_action(‘the_excerpt’, ‘tm_update’);
tweetmeme
When you done with changes you will be able to see tweetmeme button with wordpress post excerpt also.

Updated tweetmeme.php file you can download from here. Please right click and choose save as option.

Now I am going to talk about facebookshare plugin. I opened the facebookshare.php file. This file you will find in wordpress plugins facebook-share-new folder.

Add following code to line no 843

add_filter(‘the_excerpt’, ‘fb_share’);

When you done with changes you will be able to see facebookshare button with wordpress post excerpt also.

Updated facebookshare.php file you can download from here. Please right click and choose save as option.

Written by Purab Kharat

I am Purab , a Blogger. I worked as WordPress and Drupal Architect and consultant. I worked on many technologies like Wordpress, Drupal, Ruby on Rails, Flex, PHP, jQuery etc... Senior Technical Lead at Smartsourcing Global Pvt Ltd in Princeton, NJ, USA.I contributor of many wordpress plugins and Drupal Modules. I am core developer of Drupal.Connect to purab on LinkedIn or Follow @purab on Twitter or Follow me on Google+ or Write Mail to [email protected] or Chat with me on Skype : purabdk

Loading Facebook Comments ...

This article has 8 comments

    • sony Reply

      What you are trying with this path…I did not get you. send me the full details.

  1. casy mear Reply

    hello,

    Do you know how to implement with tweetmeme.php Version: 1.8.2 ?
    thanks

  2. Steve Reply

    This doesn’t seem to work with the newest version of Tweetmeme (1.8.5). Has anyone had luck with this version?

  3. jdscher Reply

    Here’s how to get it to work in version 1.9, by adding the 2nd line and commenting out the 3rd line. Identical to this articles directions but also includes the ,8 at the end of the enabled add_filter lines.

    add_filter(‘the_content’, ‘tm_update’, 8);
    add_filter(‘the_excerpt’, ‘tm_update’, 8);
    //add_filter(‘get_the_excerpt’, ‘tm_remove_filter’, 9);

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>