【问题标题】:Share button on twitter not working properly推特上的分享按钮无法正常工作
【发布时间】:2018-05-22 01:34:25
【问题描述】:

我想在我的网站上添加 twitter 按钮。 我使用的代码是:

echo"<iframe src='https://www.facebook.com/plugins/share_button.php?href=http%3A%2F%2Fconnecting-youth.org%2Fsingle_news.php%3Fsubmit%3D".$lastnum."&layout=button_count&size=small&mobile_iframe=true&width=69&height=20&appId' width='69' height='20' style='border:none;overflow:hidden' scrolling='no' frameborder='0' allowTransparency='true'></iframe>
    <a style='margin-left:10px;' class='twitter-share-button'  href='https://twitter.com/share?url=http%3A%2F%2Fconnecting-youth.org%2Fsingle_news.php%3Fsubmit%3D".$lastnum."'  data-size='large'>Tweet</a>
    ";

问题是它在 twitter 上显示为文本而不是帖子。 例如

我希望它出现的方式是:

当我添加另一个 URL 时它工作正常。

【问题讨论】:

  • 如果那是您使用的 exact 代码,那么您需要回显 php 变量以将其包含在 url 中:&lt;a class='twitter-share-button' href='https://twitter.com/share?url=http%3A%2F%2Fconnecting-youth.org%2Fsingle_news.php%3Fsubmit%3D&lt;?php echo $lastnum; ?&gt;' data-size='large'&gt;Tweet&lt;/a&gt; 否则,您能请包括您正在使用的整行代码?此外,非工作和工作链接的示例输出将非常有帮助。
  • @mtr.web 我包含了整行代码。在任何情况下,该链接都已正确粘贴到 Twitter 上,但它没有显示为应有的(输出显示在问题中包含的捕获中)

标签: php html twitter


【解决方案1】:

尝试使用例如 https://bitly.com 来缩短它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-07
    • 2015-01-31
    • 1970-01-01
    • 2022-01-19
    • 1970-01-01
    相关资源
    最近更新 更多