【问题标题】:Linkedin show 3 different image when sharingLinkedin 分享时显示 3 张不同的图片
【发布时间】:2015-05-14 11:51:00
【问题描述】:

Linkedin 在尝试分享时显示不同的 3 张图片。然后是头标签

<meta property="og:site_name" content="OkyTalk">
<meta property="og:title" content="OkyTalk ">
<meta property="og:type" content="website">
<meta property="og:url" content="https://okytalk.com/teachers/profile/displayProffesional">
<meta property="og:image" content="https://okytalk.com/media/okytalk/img/share.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="470">
<meta property="og:image:height" content="246">

任何想法如何只显示一个?其他人分享(facebook、twitter、google+)效果很好。

【问题讨论】:

    标签: html linkedin facebook-opengraph social-media socialshare


    【解决方案1】:

    自 2015 年以来,情况肯定发生了变化!例如,整个LinkedIn公司都被微软收购了,LinkedIn.com上几乎所有LinkedIn的旧文档都只有404个。如果其他人仍然有这个问题,我会发布。

    引用 Microsoft LinkedIn Share Documentation,您希望您的分享 URL 实际上是...

    https://www.linkedin.com/sharing/share-offsite/?url={url}
    

    您的og: 标签似乎是正确的,它们应该在今天,即 2020 年得到正确解释。似乎它们仅在您提出问题两年后的 2017 年才得到官方支持。看看LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn。这些应该可以工作...

    • &lt;meta property='og:title' content='Title of the article"/&gt;
    • &lt;meta property='og:image' content='//media.example.com/ 1234567.jpg"/&gt;
    • &lt;meta property='og:description' content='Description that will show in the preview"/&gt;
    • &lt;meta property='og:url' content='//www.example.com/URL of the article" /&gt;

    不要忘记,一旦您完成所有编码并完成,您就可以测试您的页面了!获取您网站的 URL(example.com,而不是 linkedin.com/share?site=example.com),并将其输入到 LinkedIn Post Inspector

    这是一个online demo,我使用 20 多个共享服务创建(100% 没有货币收入,它被设计为一个测试站点)。查看源代码,了解它如何使 LinkedIn URL 与 og: 标记一起使用。

    希望所有这些信息对某人有所帮助!

    【讨论】:

      【解决方案2】:

      LinkedIn 出于某种原因在 img 标签中提取图片,这与 Facebook 等不同。

      解决方法是更改​​您共享页面上的img标签中的图像以将图像设置为CSS并将img标签更改为div。

      添加如下样式:

      #howitworksstudent{
        background: url(https://okytalk.com/media/okytalk/img/how-it-works-student.png);
        width: 100%;
        height: 100%;
        background-repeat: no-repeat;
      }
      

      并将您的 img 标签更改为:

      <div id="howitworksstudent"/>
      

      不理想,但可以解决问题。我已经对此进行了测试,并且能够重新创建您的初始问题,所以我知道它有效。

      希望对您有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-06-14
        • 1970-01-01
        • 2012-11-25
        • 1970-01-01
        • 2015-05-09
        • 2013-07-11
        • 1970-01-01
        相关资源
        最近更新 更多