开发者

image-tags for google or facebook [duplicate]

开发者 https://www.devze.com 2023-03-19 09:02 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How does Facebook Sharer select Images?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How does Facebook Sharer select Images?

i have a blog with some images on it. now i want a specific one to appear on pages like google+ or facebook. when i click on "+1" it shows a facebook-image, but not the image of the actual blog-entry. its the same with facebook :(

do i have to give the image a specia开发者_如何学Gol tag or so?

name="blog-name" title="blog-name" alt="blog-name" ?

example:

<img src="/TwitterIcon.png" title="Blogname auf Twitter" width="22px" border="0">

works

<img src="/m/home_button.png" title="Blogname" width="50px" border="0">

doesnt work


Forget the tags on the images, use the Open Graph protocol. Let Facebook scrape via Open Graph-friendly meta tags:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="https://www.facebook.com/2008/fbml">
  <head>
    <title>The Rock (1996)</title>
    <meta property="og:title" content="The Rock"/>
    <meta property="og:type" content="movie"/>
    <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
    <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
    <meta property="og:site_name" content="IMDb"/>
    <meta property="fb:admins" content="USER_ID"/>
    <meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>
    ...
  </head>
  ...
</html>

This will result in Facebook grabbing http://ia.media-imdb.com/rock.jpg.

0

精彩评论

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