Lucifr

分享网络、博客、软件及其它趣事

给 Wordpress 添加分享到 Buzz 的按钮

| Comments

Google 官方的 Buzz 分享按钮已经上线了,请移步到这里

看到著名的 Mashable 博客 已经在他们的站点里添加了分享到 Buzz 的按钮,其实是利用分享到 Google Reader 实现的。

Wordpress 手动添加分享到 Buzz 按钮

在 Wordpress 里手动添加一个分享到 Buzz 的按钮也不是难事,在所用的主题的单篇文章的模板里(如 single.php) 里找个顺眼的位置添加如下链接代码即可:

1
<a href="http://www.google.com/reader/link?url=<?php the_permalink() ?>&title=<?php the_title(); ?>&srcURL=<?php bloginfo('url'); ?>&srcTitle=<?php bloginfo('name'); ?>" target="_blank">分享到 Buzz</a>

或者你也可以 DIY 个 Buzz 的 Logo 来替换“分享到Buzz”这几个字,例如。

1
<a href="http://www.google.com/reader/link?url=<?php the_permalink() ?>&title=<?php the_title(); ?>&srcURL=<?php bloginfo('url'); ?>&srcTitle=<?php bloginfo('name'); ?>" target="_blank"><img src="http://static.zooomr.com/images/8895588_6e196b964c_s.jpg" title="分享到 Buzz"></a>

Sociable 插件添加 Buzz

如果是像 Lucifr 一样使用的 Sociable 这个插件的,可以到 wp-content/plugins/sociable 目录中找到 sociable.php 文件,在 $sociable_known_sites = Array() 里按照格式加入如下代码:

1
2
3
4
'Buzz' => Array(
  'favicon' => 'buzz.png',
  'url' => 'http://www.google.com/reader/link?url=PERMALINK&title=TITLE&srcURL=你的首页地址&srcTitle=你的博客标题',
 ),

然后下载 Lucifr 做的这个16*16的 Buzz小图标,放到 wp-content/plugins/sociable/images 里即可。

更新:纠正了出现 null 的小错误

Comments