How to show tweetmeme button and facebook share button with the_excerpt function.

Sponsors

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.

facebook-twitter

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.

Incoming search terms:

You may like following Articles!

This entry was posted in facebook, twitter, wordpress, wordpress api and tagged , , , by Wordpress API. Bookmark the permalink.

About Wordpress API

API means Application Program interface. In Wordpress API we are giving all the information about wordpress API. We worked for many wordpress plugins and themes. We have expertise in PHP, Databases, Graphic Design, Ruby on Rails, Java, Wordpress, Drupal and many CMS. We always give you the best solutions about wordpress and other related topics in This Blog. We will give you always fresh tips and tricks and techniques about wordpress in this blog.

22 thoughts on “How to show tweetmeme button and facebook share button with the_excerpt function.

  1. Awesome blog and i should totally take notice with you on this one here. Its hillarious, thats what i can say about this post. Because this is what this whole site is all about right? Keep on doing a great job!

  2. Dreamweaver has been my personal goto program for years. I really do not know what I would do with out it. There were occasions when I first began using the software, and I believed it was way too sophisticated. Now I fly around it, and it has become an asset in my tool box. Anyhow thanks for the write-up.

  3. Thanks.

    What I am trying to achieve is the same as you, having a row of social icon buttons on my WP blog, which is self-hosted.

    I found a set of free icons online, and uploaded them to the folder I indicate in my previous comment (inside the “images” folder in my currently installed WP theme, “Restaurant”)

    Then, I added a Text widget from the WP widget dashboard, as indicated.

    Pasted your code and replaced the blog´s URL and icon folder filepath with my own.

    When I open my blog on another window, I can´t see the couple of icons I installed, instead I get a couple of “?” (white interrogation symbol inside a blue square) images, the kind you get when the browser doesn´t find an image.

    When I click on those “?” icons, I get a 404 error, the link seems to be broken.

    So, basically the situation is:

    1. I can´t get the icon images to appear on the blog
    2. I can´t get the links to work

    Where do I have to drop the icons, what is the correct path?
    And how do I manage to get the icons to link properly to my twitter and Facebook fanpage?

    Best,

    Arturo

  4. Really Good! I like your blog, its layout is really fine. Keep it up!
    Visit my site to check how I add 5000 friends in 7 days and get huge traffic to my site everyday.
    Thanks

  5. I dont know what to say. This really is certainly one of the much better blogs Ive examine. Youre so insightful, have so much actual things to bring for the table. I hope that a lot more people examine this and get what I got from it: chills. Fantastic job and wonderful web site. I cant wait to understand a lot more, retain them comin!

  6. 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 Reply

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>