问题描述:

I want to add facebook like button to every pages.

But the problem is that the like button are showing first time when page are loading then if anyone are like the button then the like button are invisble.

I was test url into https://developers.facebook.com/docs/reference/plugins/like/

here and getting the same problem. I am not getting any problem when i am testing with http://fridaymedia.in/

But when I am testing with

http://fridaymedia.in/TP_ECom/

http://fridaymedia.in/TP_ECom/retail/

http://fridaymedia.in/TP_ECom/retail/details/

http://fridaymedia.in/TP_ECom/retail/details/men-clothing-t-shirts/

They are getting the problem.

Please anyone solve this problem?

网友答案:

Are your site's pages protected with an .htaccess password? If so, that could be the issue. I ran into this problem myself, and after going down the wrong path for a bit, I went back to my initial suspicion - htaccess password.

I didn't really look into the code, but I assume the button is set to have FB scrape the page after a user clicks like. With the password blocking things, FB can't scrape the page. Rather than displaying the button as if it hadn't been clicked, it just displays nothing - which is where my, and I assume your, confusion came in.

After changing htaccess, you'll have to wait 24 hours for the page(s) to be scraped by FB when they're loaded. However, you can use the FB debugger (http://developers.facebook.com/tools/debug) to manually scrape individual pages.

相关阅读:
Top