开发者

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

开发者 https://www.devze.com 2023-04-01 18:07 出处:网络
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

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

精彩评论

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