【问题标题】:Facebook, Google+ and twitter like button on websiteFacebook、Google+ 和 twitter 喜欢网站上的按钮
【发布时间】:2011-10-19 19:15:22
【问题描述】:

如何在我的网站上添加 Facebook、Google+ 和 twitter 的点赞/分享按钮,以分享我网站的详细信息。因为,我在我的网站上为 google+ 尝试了以下代码。但是,它只是分享我的网站图片,而不是我网站的描述和标题

<meta itemprop="name" content="MySMSBuddy">
<meta itemprop="description" content="Description of my webpage">
<meta itemprop="image" content="http://eravikant.com/images/image.png">

<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

任何帮助和想法将不胜感激!!!

【问题讨论】:

  • 您是否在 StackOverflow 上搜索过这些内容,例如“Google+ 按钮”或“Facebook Like 按钮”?这些非常简单的查询提出了一系列以前提出的问题。我想您可以通过阅读其中的一些内容获得很多帮助。
  • 我搜索了.. 但是,我的问题是,当我尝试使用 google+ 分享我的网站详细信息时,它只显示图片而不是我网站的标题和描述。

标签: facebook twitter google-plus


【解决方案1】:

这些网站使用 title 标签作为页面标题,meta name="description" 作为描述(而不是 itemprop="description"。

<title>Title of your page</tile>
<meta name="description" content="Description of your page" /> 

对于 Facebook,您还可以使用开放图元标记:

 <meta property="og:title" content="Title"/>
 <meta property="og:description" content="Description"/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多