Get Recent Commentsは、wordpressのサイドバーに「最近のコメント」を表示するwidgetです。
エントリごとに、コメントをまとめたいと思い導入しました。
FC2ブログでは普通に実装されていたと思うんだけど、それに慣れちゃって、気になっていたんですよね。
検索してみると、日本語に対応していないとか文字化けするとかありましたが、現時点のバージョン Version: 2.0.6 Last Updated: 2009-3-31 では問題なし。
設定ではマクロが使えて自由自在って感じです。
一カ所だけ、日時のフォーマットがシステムのデフォルトに固定されていたので、そこだけソースをいじりました。
get-recent-comments.php
[sourcecode language=”php” firstline=”1321″]
$comment_date = mysql2date(get_settings(‘date_format’),$comment->comment_date);
[/sourcecode]
get_settings(‘date_format’)を、むりやり ‘y/m/d’ に書き換え。
[sourcecode language=”php” firstline=”1321″]
$comment_date = mysql2date(‘y/m/d’,$comment->comment_date);
[/sourcecode]
設定で、Template for the comments. の欄を、
[sourcecode language=”xhtml” firstline=””]
<li><a href="%comment_link" title="%post_title, %post_date">%comment_author san: <span class="NREW-Date">(%comment_date)</span></a></li>
[/sourcecode]
こんな感じにして、[post=”1333″]と表示をそろえたりして。
そろえてみると、こっちにも New!マークが欲しくなってきたりして。
でもこうやって人様のソースをいじると、ついうっかり、プラグインの自動アップデートしちゃって修正を失ってしまうんだようなぁ。 🙁
コメントを残す