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
-
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..– abrudtkuhlOct 19, 2010 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.– goldenapplesOct 19, 2010 at 21:19
-
Good point that would cause some load issues... The JS SDK would have to be a better choice– abrudtkuhlOct 21, 2010 at 15:06
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()); ?>&layout=standard&show_faces=false&width=450&action=like&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. ;)
-
-
Awesome that's the direction I was leaning... Thanks! May try to hack that into a plugin for others to use as well Oct 19, 2010 at 18:34