如何在WordPress中添加社交媒体共享计数窗口小部件

在此博客的早期,我们为WordPress创建了社交媒体备忘单,但这只是向您展示了如何添加社交媒体按钮。随着社交媒体的发展和网络的成熟,我们看到的社交媒体按钮越来越少。社交媒体按钮正在被共享计数窗口小部件取代,例如tweetmeme转推窗口小部件,digg计数器,facebook共享等等。在本文中,我们将向您展示如何在WordPress中添加不同的社交媒体共享计数按钮。

抓取原始窗口小部件

大多数共享计数是您必须从中检索的一段JavaScript社交媒体服务。这篇文章也意味着作为一站式商店。您可以来这里找到顶级社交媒体服务的位置,因为很多这些服务很难在他们的网站上找到。本文的目标是避免使用尽可能多的插件,因此当您选择类型时选择site:Normal。

  • Digg
  • StumbleUpon
  • Tweetmeme转发%%%% %Facebook分享
  • Facebook喜欢Button
  • Reddit
  • Njuice Google Buzz
  • Sphinn
  • 自定义代码

因为我们选择了代码在普通网站上,我们可能需要修改它以使其与WordPress兼容。我们还将展示Compact Compact Count Buttons。您可以使用代码作为指导来获得不同的大小。

注意:您必须将所有这些代码粘贴到循环中,最有可能在您的

single.php single.php file。

Digg

<script type="text/javascript">  (function() {  var s = document.createElement("SCRIPT"), s1 = document.getElementsByTagName("SCRIPT")[0];  s.type = "text/javascript";  s.async = true;  s.src = "http://widgets.digg.com/buttons.js";  s1.parentNode.insertBefore(s, s1);  })();  </script>    <a  href="http://digg.com/submit?url=<?php the_permalink(); ?>"></a>

通常,您不必添加链接区域的href部分。但是如果你没有,并且你有分页评论或帖子,那么你的digg按钮将不适用于所有页面。因此,如果主页面已提交,则第二页将显示提交URL,允许用户向digg提交重复内容。

StumbleUpon

<script src="http://www.stumbleupon.com/hostedbadge.php?s=1&r=<?php the_permalink(); ?>"></script>

Tweetmeme转发

<script type="text/javascript">  tweetmeme_source = "wpbeginner"; tweetmeme_service = "bit.ly"; tweetmeme_style = "compact"; tweetmeme_url = "<?php the_permalink() ?>";  </script>  <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>

确保更改Tweetmeme_source变量到您的Twitter句柄。现在是@wpbeginner。因此,每当有人点击它将显示RT @wpbeginner帖子标题 – 链接。我们使用bit.ly作为链接缩短服务,您可以将其更改为tweetmeme提供的其他人,但bit.ly是最好的。

Facebook Share

<a name="fb_share" type="button_count" share_url="<?php the_permalink(); ?>" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Facebook Like Button %%%% %Facebook Like Button是一种用于流量的phonemonal工具。 Syed过去曾在我们的WordPress时事通讯中展示了它的帮助。

要查看更多选项,请参阅如何在WordPress中添加Facebook Like按钮。

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp; scrolling="no" frame allowTransparency="true" ></iframe>

Reddit

Njuice Google Buzz Count% %%%% Google Buzz没有可用于跟踪计数的活动API。有几种方法可以解决这个问题。但是对于那些想要拥有Google Buzz Count的用户来说,这就是你可以添加它的方法。

<script type="text/javascript">  reddit_url = "<?php the_permalink(); ?>";  reddit_title = "<?php the_title(); ?>";  </script>  <script type="text/javascript" src="http://reddit.com/static/button/button1.js"></script>

Sphinn

LinkedIn按钮

<script type="text/javascript">  var njuice_buzz_size = "small";  var njuice_buzz_title = "<?php the_title(); ?>";  var njuice_buzz_url = "<?php the_permalink(); ?>";  </script>  <script type="text/javascript" src="http://button.njuice.com/buzz.js"></script>

来源:如何添加官方LinkedIn按钮WordPress的

<script type="text/javascript">submit_url = "<?php the_permalink(); ?>";</script>  <script type="text/javascript" src="http://sphinn.com/evb/buttons.php?b=small"></script>

LinkedIn按钮

<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script><script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="top"></script>

来源:如何在WordPress中添加官方LinkedIn按钮

这就是我们需要进行的所有定制,以使每个小部件都能与WordPress完美配合。现在,您可能必须自定义样式以使其与主题设计一起使用。你最好把这些代码放在&lt;?php the_content(); ?&gt; 代码。您还可以使用我们的智能共享插件,在窗口中显示浮动图标。

您是否还有其他想要添加的社交媒体小部件?请告诉我们,我们可以在这里获取代码。如果您正在使用其他小部件并准备好代码,请将其提交给我们,以便其他人也可以从中受益。

在此博客的早期,我们为WordPress创建了社交媒体备忘单,但这只是向您展示了如何添加社交媒体按钮。随着社交媒体的发展和网络的成熟,我们看到的社交媒体按钮越来越少。社交媒体按钮正在被共享计数窗口小部件取代,例如tweetmeme转推窗口小部件,digg计数器,facebook共享等等。在本文中,我们将向您展示如何在WordPress中添加不同的社交媒体共享计数按钮。

抓取原始窗口小部件

大多数共享计数是您必须从中检索的一段JavaScript社交媒体服务。这篇文章也意味着作为一站式商店。您可以来这里找到顶级社交媒体服务的位置,因为很多这些服务很难在他们的网站上找到。本文的目标是避免使用尽可能多的插件,因此当您选择类型时选择site:Normal。

  • Digg
  • StumbleUpon
  • Tweetmeme转发%%%% %Facebook分享
  • Facebook喜欢Button
  • Reddit
  • Njuice Google Buzz
  • Sphinn
  • 自定义代码

因为我们选择了代码在普通网站上,我们可能需要修改它以使其与WordPress兼容。我们还将展示Compact Compact Count Buttons。您可以使用代码作为指导来获得不同的大小。

注意:您必须将所有这些代码粘贴到循环中,最有可能在您的

single.php single.php file。

Digg

<script type="text/javascript">  (function() {  var s = document.createElement("SCRIPT"), s1 = document.getElementsByTagName("SCRIPT")[0];  s.type = "text/javascript";  s.async = true;  s.src = "http://widgets.digg.com/buttons.js";  s1.parentNode.insertBefore(s, s1);  })();  </script>    <a  href="http://digg.com/submit?url=<?php the_permalink(); ?>"></a>

通常,您不必添加链接区域的href部分。但是如果你没有,并且你有分页评论或帖子,那么你的digg按钮将不适用于所有页面。因此,如果主页面已提交,则第二页将显示提交URL,允许用户向digg提交重复内容。

StumbleUpon

<script src="http://www.stumbleupon.com/hostedbadge.php?s=1&r=<?php the_permalink(); ?>"></script>

Tweetmeme转发

<script type="text/javascript">  tweetmeme_source = "wpbeginner"; tweetmeme_service = "bit.ly"; tweetmeme_style = "compact"; tweetmeme_url = "<?php the_permalink() ?>";  </script>  <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>

确保更改Tweetmeme_source变量到您的Twitter句柄。现在是@wpbeginner。因此,每当有人点击它将显示RT @wpbeginner帖子标题 – 链接。我们使用bit.ly作为链接缩短服务,您可以将其更改为tweetmeme提供的其他人,但bit.ly是最好的。

Facebook Share

<a name="fb_share" type="button_count" share_url="<?php the_permalink(); ?>" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Facebook Like Button %%%% %Facebook Like Button是一种用于流量的phonemonal工具。 Syed过去曾在我们的WordPress时事通讯中展示了它的帮助。

要查看更多选项,请参阅如何在WordPress中添加Facebook Like按钮。

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp; scrolling="no" frame allowTransparency="true" ></iframe>

Reddit

Njuice Google Buzz Count% %%%% Google Buzz没有可用于跟踪计数的活动API。有几种方法可以解决这个问题。但是对于那些想要拥有Google Buzz Count的用户来说,这就是你可以添加它的方法。

<script type="text/javascript">  reddit_url = "<?php the_permalink(); ?>";  reddit_title = "<?php the_title(); ?>";  </script>  <script type="text/javascript" src="http://reddit.com/static/button/button1.js"></script>

Sphinn

LinkedIn按钮

<script type="text/javascript">  var njuice_buzz_size = "small";  var njuice_buzz_title = "<?php the_title(); ?>";  var njuice_buzz_url = "<?php the_permalink(); ?>";  </script>  <script type="text/javascript" src="http://button.njuice.com/buzz.js"></script>

来源:如何添加官方LinkedIn按钮WordPress的

<script type="text/javascript">submit_url = "<?php the_permalink(); ?>";</script>  <script type="text/javascript" src="http://sphinn.com/evb/buttons.php?b=small"></script>

LinkedIn按钮

<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script><script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="top"></script>

来源:如何在WordPress中添加官方LinkedIn按钮

这就是我们需要进行的所有定制,以使每个小部件都能与WordPress完美配合。现在,您可能必须自定义样式以使其与主题设计一起使用。你最好把这些代码放在&lt;?php the_content(); ?&gt; 代码。您还可以使用我们的智能共享插件,在窗口中显示浮动图标。

您是否还有其他想要添加的社交媒体小部件?请告诉我们,我们可以在这里获取代码。如果您正在使用其他小部件并准备好代码,请将其提交给我们,以便其他人也可以从中受益。

相关推荐

发表回复

房先生
我们将24小时内回复。
2024-07-12 05:14:40
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[加我微信]
chaoneo
注:点击复制微信号并打开微信APP,添加好友后进行聊天。
[电话联系]
13585372227
[电子邮件]
chaoneo@163.com
取消

选择聊天工具: