You are currently browsing the WordPressメモ weblog archives for the day 土曜日, 3月 31st, 2007.

WordPressにソーシャルブックマーク追加ボタンを表示させる・まとめ

前回の投稿で「はてなブックマークボタンを表示する方法」を載せましたが、それ以外のソーシャルブックマークの追加ボタンを表示する方法について調べたので、こちらにまとめておきます。
↑タイトルの上に表示されているようなボタンを作ります♪クリックすると各ソーシャルブックマークに追加されます♪

まず、ボタン各画像「右クリック>名前を付けて画像を保存」でダウンロードし、それぞれを自分のサーバーにアップロードします。

 
画像を自分のサーバーにアップロードしたら、下のコードを表示したい場所に貼り付けます。
※下のコードの「画像を保存したURL」を自分が画像を保存したURIに変更してください。
貼り付け場所は好みですが、私はpage.phpとsingle.phpの中に貼り付けました。index.phpに貼り付けてもよいでしょう。

はてな
<a href="http://b.hatena.ne.jp/append?<?php the_permalink() ?>" rel="nofollow"><img alt="はてなにブックマーク" src="画像を保存したURL" /></a>

del.icio.us
<a href="javascript:location.href=’http://del.icio.us/post?v=4;url=’+encodeURIComponent(location.href)+’;title=’+encodeURIComponent(document.title)" rel="nofollow"><img alt="このページをdel.icio.usに登録" src="画像を保存したURL" /></a>

Livedoorクリップ
<a href="http://clip.livedoor.com/redirect?link=<?php the_permalink() ?>&title=<?= urlencode(mb_convert_encoding(the_title("","",false),"UTF-8")) ?>&jump=ref" class="ldclip-redirect" title="この記事をクリップ!"><img src="画像を保存したURL" width="16" height="16" alt="この記事をLivedoorクリップ!" style="border: none;vertical-align: middle;" /></a>

ニフティクリップ
<a href="javascript:(function(){location.href=’http://clip.nifty.com/create?url=’+encodeURIComponent(location.href)+’&amp;title=’+encodeURIComponent(document.title);})()" rel="nofollow"><img alt="このエントリをニフティクリップに登録" src="画像を保存したURL" /></a>

Buzzurl
<a href="http://buzzurl.jp/entry/<?php the_permalink() ?>" rel="nofollow"><img alt="このエントリをBuzzurlにブックマーク" src="画像を保存したURL" /></a>

POOKMARK Airlines
<a href="javascript:window.location=’http://pookmark.jp/post?url=’+encodeURIComponent(’<?php the_permalink() ?>’)+’&title=’+encodeURIComponent(’<?php the_title() ?>’);" title="このページを POOKMARK Airlines の行き先に登録する"><img src="画像を保存したURL" alt="このページを POOKMARK Airlines の行き先に登録する" […]