首页 > 解决方案 > Twitter 图片未出现在 WordPress 网站的推文中

问题描述

我正在创建一个 WordPress 插件,在其中添加点击推文功能以获取报价。以下是来自http://www.msblogs.mattjennings.net/2018/05/21/another-example-quote/的示例 HTML 代码

<a style="text-decoration: none;" onclick="window.open('https://twitter.com/intent/tweet?text=You%20must%20be%20the%20change%20that%20you%20wish%20to%20see%20in%20the%20world.%20%23gandi%20http://www.msblogs.mattjennings.net/2018/05/21/another-example-quote', '_blank', 'width=500,height=500'); return false;" href="#">
  <blockquote>
    <span class="dashicons dashicons-format-quote" style="color: #1da1f2; font-size: 45px; padding-right: 65px; display: block; float: left; height: 50px;"></span>
    <p style="display: inline; padding-top: 10px; font-size: 25px; font-style: normal; color: rgb(0, 0, 0);" onmouseover="this.style.color='#1da1f2'" onmouseout="this.style.color='#000'">You must be the change that you wish to see in the world.</p>
    <p style="color: #1da1f2; font-style: normal; padding-left: 65px;"><i class="dashicons dashicons-twitter" style="color: #1da1f2; font-size: 25px; display: block; float: left; padding-right: 30px;"></i>Click to Tweet</p>   
  </blockquote>
</a>

在同一页面上,我也有一个<meta name="twitter:image" content="http://www.msblogs.mattjennings.net/wp-content/uploads/2018/05/gandi-quote.png" />标签。

但是,当我单击该页面上的“点击推文”链接并推文时,<meta name="twitter:image" ... />标签中的照片不会出现在推文中: https ://twitter.com/iluvmibanh/status/998709839936217088

我怎样才能让这张图片出现在推文中?

标签: javascripthtmlwordpresstwitter

解决方案


照片(取自<meta name="twitter:image" ... />标签)似乎需要几个小时才能与推文一起出现。谢谢你。


推荐阅读