May 2013
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

How to add Facebook comment area to WordPress blog

We added Facebook comment area to this blog using comment plugin (blog parts) provided by

http://developers.facebook.com/docs/reference/plugins/comments/.

But this code supports the TOP URL only, so even if visitors comment the post, the target links are always the top url.

How to link  to each post via facebook comment plugin is like this.  (The case of WordPress blog)

echo ‘<br/><div id=”fb-root”></div><script src=”http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1″></script><fb:comments href=”‘;
the_permalink();
echo ‘” num_posts=”2″ width=”500″></fb:comments>’;

the_permalink() is WordPress function to give each post link, so you need to replace the url with it.

*CAUTION:  the_permalink() outputs the link by itself , not link strings, so you have to split the code into some ‘echo’s.

(echo ‘<fb:comments…’ + the_permalink() + ‘/fb:comments>’ will not work.)

Other blogs that support post link API or variables will do in the same steps,  I think.



Multilingual Text Editor

Sorry, this entry is only available in 日本語.



My first WordPress

Sorry, this entry is only available in 日本語.