今更wordpressにGravatarの導入。
wp_gravatar 導入方法
上記のサイトから、zipファイルをダウンロード。
wp_gravatarフォルダごと、wp-content/pulginsフォルダにアップ。
プラグインの有効化を行う。
WPのバージョンによって方法が違うのかもしれませんので注意してください。
[sourcecode language=”php” wraplines=”false”]
<?php if (” != get_comment_author_url()) {
echo "<a href=’$comment->comment_author_url’ title=’Visit $comment->comment_author’>";
$gravatar_alt = $comment->comment_author."’s Gravatar";
} else {
echo "<a href=’http://www.gravatar.com’ title=’Create your own gravatar at gravatar.com!’>";
$gravatar_alt = "Gravatarに登録するとメールアドレスに応じたユニークな画像を表示できます。";
} ?>;
<img src="<;?php gravatar() ?>" alt="<?php echo $gravatar_alt; ?>" width="80" height="80" style="float:right;margin:0px 10px 2px 10px;" /></a>
[/sourcecode]
こちらにGravatarの登録方法等が載っています。すごくわかりやすいですね。
・caramel*vanilla – Gravatarリニューアル!!登録のススメ
結果は下記のURLです。