Has anyone added this kind of functionality to a WP site before? I'm looking to add Facebook Like button to individual comments. This can be a Theme function or a plugin

link|improve this question

20% accept rate
The best answer I have found is to add the Like Button iFrame for each comment either via plugin hook or in the theme options.. – abrudtkuhl Oct 19 '10 at 17:03
Doesn't that slow your site down like a beast? I've found that even including a couple like button iframes on a page adds several seconds to page load time. I haven't tried out the FB JavaScript SDK yet, but I would think that might be a better way to go, if you're talking about including alot of these buttons on a page. – goldenapples Oct 19 '10 at 21:19
Good point that would cause some load issues... The JS SDK would have to be a better choice – abrudtkuhl Oct 21 '10 at 15:06
feedback

1 Answer

You should add the list of comments within the comments.php file the following code:

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(post_permalink() . '#comment-' . comment_ID()); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;"></iframe>

And then customize the display rules in the stylesheet. Hope that helps. ;)

link|improve this answer
Will probably be next to the item <?php comment_text(); ?> – Flávio Ricardo Oct 19 '10 at 17:31
Awesome that's the direction I was leaning... Thanks! May try to hack that into a plugin for others to use as well – abrudtkuhl Oct 19 '10 at 18:34
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.