2011年12月12日月曜日

twitterなどSocial連携ボタン設置

twitter,facebook,mixiなどのsocial連携をするべく、ボタンを設置してみました。
socialなツールを使いこなしている方は、ぜひ押してみてください。

ではその作業メモを残します。

プラグインなしでもテーマをいじることでボタン追加はできるそうですが、メンテナンス性のためプラグインに頼ることにしました。

まず、プラグイン、WP Social Bookmarking Light を導入。
このプラグインを有効化することで、各投稿の下部にボタンを並べることができました。

そんな作業の中、このテーマにはもとから、使うことのなさそうなボタンが記事の下部に組み込まれていたことに気づいたため、それを削除しました。

具体的にはテンプレートの single.php から下記を削除。
     <div id="tools">
<div style="float:left;"><a href=" http://digg.com/submit?phase=2&url= <?php the_permalink();?>&title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/digg.png" title="Digg this!"></a><a href=" http://del.icio.us/post?v=4&noui&jump=close
&url=<?php the_permalink();?>
&title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/delicious.png" title="Add to del.icio.us!"></a><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/stumbleupon.png" title="Stumble this!"></a><a href=" http://technorati.com/faves?add=<?php echo get_option('home'); ?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/technorati.png" title="Add to Techorati!"></a><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/facebook.png" title="Share on Facebook!"></a><a href=" http://www.newsvine.com/_tools/seed&save? u=<?php the_permalink();?>&h=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/newsvine.png" title="Seed Newsvine!"></a><a href=" http://reddit.com/submit?url=
<?php the_permalink();?>&title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/reddit.png" title="Reddit!"></a><a href=" http://myweb.yahoo.com/myresults/bookmarklet? t=<?php the_title();?>&u=<?php the_permalink();?>&ei=UTF" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/yahoomyweb.png" title="Add to Yahoo!"></a>
</div>

    <div style="float:right;display:block;"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>
    </div>


最後は、各ボタンの動作確認をして、mixiだけはチェックキーの登録が必要と言うことで、その作業をして終了です。
今回は特にトラブルなく完了しました。