How to add old Facebook “share” button to your blog’s post

Using the same method used for the like button, i can help you to add old (and Working) facebook share button under your wordpress’s posts. Add this function into your function.php file


function wpcode_fb_share(&wpc_share='') {
global $post;
if(is_single()) {
$wpc_share .= '<a name="fb_share" type="button_count" share_url="' . urlencode(get_permalink($post->ID)) .'" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';

    }
    return $wpc_share;
}
add_filter('the_content', 'wpcode_fb_share');
add_filter('the_title', 'wpcode_fb_share');

Pigi

Blogger, Trainee Lawyer and Wordpress Lover, and Yes, Wpcode.net Owner :D

You may also like...

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>