【问题标题】:Google Share Button grabbing all images from the page谷歌分享按钮从页面抓取所有图像
【发布时间】:2017-03-15 21:16:11
【问题描述】:

我的目标是使用 google 分享按钮让人们分享我博客中的内容。我在这里使用了 google share sn-p :

<a target="_blank" href="https://plus.google.com/share?url=<? echo $permalink; ?>"><i class="fa fa-google-plus" aria-hidden="true"></i></a>

上下文:

我博客中的每篇文章实际上都是餐厅评论。 经典的餐厅评论页面包含带有&lt;img&gt; 标签的滑块。我的侧边栏还包含一个带有&lt;img&gt; 标签的滑块,用于最近的帖子。 要自定义我的 facebook 分享按钮,我使用 Open Graph 标签,如下所示:

<link rel="canonical" href="http://grain2sel.fr/france/iledefrance/paris/mamie-burger" />
<link rel="publisher" href="https://plus.google.com/u/0/108380150528993749302"/>
<meta property="og:locale" content="fr_FR" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Mamie Burger - Grain2Sel" />
<meta property="og:description" content="Est-ce que votre grand-mère vous fait souvent des Burgers ? Moi j’ai trouvé la grand-mère à la pointe de la modernité et des..." />
<meta property="og:url" content="http://grain2sel.fr/france/iledefrance/paris/mamie-burger" />
<meta property="og:site_name" content="Grain2Sel" />
<meta property="article:publisher" content="https://www.facebook.com/grain2sel.fr/" />
<meta property="article:tag" content="Américain" />
<meta property="article:tag" content="Burger" />
<meta property="article:tag" content="En famille" />
<meta property="article:section" content="Paris" />
<meta property="article:published_time" content="2014-12-11T12:28:44+01:00" />
<meta property="article:modified_time" content="2017-03-13T15:01:40+01:00" />
<meta property="og:updated_time" content="2017-03-13T15:01:40+01:00" />
<meta property="fb:app_id" content="238884123187421" />
<meta property="og:image" content="http://grain2sel.fr/wp-content/uploads/2017/03/Mamie_burger_1-1280x720.jpg" />
<meta property="og:image:width" content="870" />
<meta property="og:image:height" content="489" />

根据我的阅读,我需要谷歌:

<meta property="og:title" content="Mamie Burger - Grain2Sel" />
<meta property="og:description" content="Est-ce que votre grand-mère vous fait souvent des Burgers ? Moi j’ai trouvé la grand-mère à la pointe de la modernité et des..." />
<meta property="og:image" content="http://grain2sel.fr/wp-content/uploads/2017/03/Mamie_burger_1-1280x720.jpg" />

问题:

虽然标题和描述很好地显示在共享弹出框中,但我页面中的所有图像也都被放置了。 提供的第一个图像是 og 标记中的图像。然后是餐厅滑块中的所有图像,最后是最近帖子滑块中的所有图像。 这些最后的图像显然不在这里,因为它们与当前文章无关。

详情:

我也尝试了 schema.org 标签,但没有任何改进。

问题:

是否可以强制分享者只使用我选择的图片 og标签?

_

或者是否可以从解析中删除其他图像 分享者?

非常感谢您的帮助!

【问题讨论】:

    标签: html google-plus facebook-opengraph share-button


    【解决方案1】:

    您不能告诉 Google+ 排除图片。如果您不希望图像成为选项,则必须不将其包含在 HTML 响应中。您应该使用+Snippets 告诉 Google+ 您要使用哪些图片,但 Google+ 不保证会使用哪一张。

    【讨论】:

    • 感谢您的回复。实际上,我使用 +Snippets 并且效果很好。这意味着我希望出现在共享页面上的图像是第一个建议的图像,但随后是我页面中的所有其他图像。
    猜你喜欢
    • 2017-09-05
    • 1970-01-01
    • 1970-01-01
    • 2020-11-14
    • 1970-01-01
    • 2011-08-03
    • 1970-01-01
    • 2021-07-20
    • 2022-08-12
    相关资源
    最近更新 更多