开发者

Facebook Like taking root domain

开发者 https://www.devze.com 2023-02-10 04:46 出处:网络
I\'m trying to implement a Facebook Like button on my site. It\'s at a subdomain. I\'ve tried putting the link in the script tag of the Like button and now I\'m trying to use Open Graph meta tags. Ne

I'm trying to implement a Facebook Like button on my site. It's at a subdomain.

I've tried putting the link in the script tag of the Like button and now I'm trying to use Open Graph meta tags. Neither works. I have:

<meta property="og:title" content="My Site"/>
<meta property="og:type" content="article"/>
<meta property="og:image" content="http://www.example.com/image1.png"/>
<meta property="og:url" content="http://mysite.example.com/"/>
<meta property="og:site_name" content="My Site"/>
<meta property="fb:app_id" content="123123123"/>

And the button:

<script src="http://connect.facebook.net/en_US/all.js#开发者_StackOverflowxfbml=1"></script><fb:like show_faces="false" width="450"></fb:like>

It works, but when I like something it says:

John likes My Site on example.com.

How can I make it use the subdomain? I have the subdomain listed in the application settings as well.

Thanks


Try adding the full url of the page to like as the href value on the fb:like element. Something like:

<fb:like href="http://mysite.example.com/" show_faces="false" width="450"></fb:like>
0

精彩评论

暂无评论...
验证码 换一张
取 消