开发者

two FB like button in the same page with different title , description and picture

Is it possible to add two button like on the same page:

  • The first: referencing http://www.mysite.com, with a title, image and description specific to the home page
  • The second: referencing http://www.mysite.com/article?id=511, with a title开发者_如何学编程, description, and image specific to article 511.


Check out the open graph protocol documentation, as you need to serve the correct tags depending on which page you're on.

For example, on the home page:

<meta property="og:title" content="My Site Name" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.mysite.com" />
<meta property="og:image" content="img" />

And on the article page:

<meta property="og:title" content="My Article Title" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.mysite.com/article?id=511" />
<meta property="og:image" content="img2" />
<meta property="og:description" content="My article description" />
<meta property="og:site_name" content="My Site Name" />

Then just serve Like buttons to those different URLs on whatever page you want.


Yes just set the href attribute on each like button to the appropriate URL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜