如果网页上没有提供图像,Twitter 会显示占位符图像

标签 twitter share facebook-opengraph meta-tags twitter-card

我正在分享一个网址 http://www.aao.org/eye-on-advocacy-article/key-congressional-committee-opposes-part-b-demo在没有任何 og:image 的推特上元标记,因为本文没有图像。

但是在 twitter 上分享 url 时,它需要一个默认的占位符图像,实际上是一个 twitter 图像 https://ton.twimg.com/tfw/assets/link_v1_e64f66f5650df987d97cc5f00c4cb5987f367028.svg与共享链接一起显示,但它应该根本不显示任何图像。
Current result when sharing on twitter

我用于此页面的 twitter 元标记是:

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="American Academy of Ophthalmology">
<meta name="twitter:title" content="Key Congressional Committee Echoes Academy’s Opposition to Medicare’s Proposed Part B Drug Demonstration">
<meta name="twitter:description" content="Our friends in Congress are pressuring CMS to change planned initiative that would hurt our ability to care for ophthalmology’s patients">
<meta name="twitter:creator">

and some other og meta tags

谁能建议我可以在页面中添加或删除什么,以便在 Twitter 上共享时没有占位符图像显示?

最佳答案

Twitter 不允许文章没有缩略图,因此您需要添加缩略图以删除默认缩略图。
试试这个:

<meta
    name="twitter:image"
    content="image url here"
  />

// If the above doesn't work

<meta
    name="og:image"
    content="image url here"
  />
如果需要,您还可以将图像设置为空白图像(白色背景或完全透明)

关于如果网页上没有提供图像,Twitter 会显示占位符图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37480668/

相关文章:

javascript - Twitter API - 上传图片

c# - 是否可以查询实际存储在 Varchar 字段中的 twitter 时间戳?

wpf - MVVM - 在 Silverlight 和 WPF 之间共享/重用 ViewModel

java - Facebook Android 开放图谱

python - 无法导入 tweepy(Python 3.7 - tweepy 3.5)

objective-c - 使用 SLComposeViewController 发布到 Twitter 在 iOS 8 设备上不工作

ios - 如何将数据传递给其他iOS应用程序?

facebook - Metas 打开图来构建与动画 gif 的共享

javascript - fb分享不带og :image dynamically

facebook - 在 FB.init 中设置用户(访问 token )