WordPressもバージョンが上がって、最初から色々付くようになりました。
サイドバーに表示してる 『新着コメント』 と言うのも、最初からは無くてプラグイン対応してたとか何とか。
(詳しく調べてないので、間違ってたらすいません。)
デフォルトのままでは少々気に入らないので、ちょっと改造してみることにします。
まず、気に入らないのが、間に 『に』 『より』 と言う文字が入る点。
(分かりやすいように、リンク部に下線入れてます。)
『に』 『より』 と言う文字を探しまくったんですが結局見つからず、仕方なくプラグインに頼る事にしました。
テーマ内 (CognoBlue 1.0) も探したんだけど・・・。
コードの中に文字があるわけないし、どっかで変換されてるんでしょうね。
私の知識じゃ探しきれません・・・。
All Things Seen and Unseen
Recent Comments
いつも通り、ダウンロードして解凍してプラグインフォルダにコピーして、管理画面で使用するにチェックを入れてでOK。
・・・と思いきや、何かエラーが出た。
英語なんで良くは分かりませんが、
「Post-Plugin Library がねーから使えねーよ、バーカ」 って言われてるようだった。
ありがたくもリンク貼ってたので、これもダウンロード → 解凍 → コピー → 使用する。
・・・で、結局これでうまくいった。
『Post-Plugin Library』 だけ使用しないで外そうにも、『Recent Comments』 を使ってる限り外れない。
2つで1つなのかな。
作者も同一人物だし、紛らわしいから1つにまとめてください・・・。
どーれ、上手くいったかな? と確認してみる。
うーん、文字は消えたけど、いまいち。
『Kuusan commented on』 と言うのはいらない。
って事で消してみる。
『plugin/post-plugin-library/output_tags.php』 をDreamweaverで開く。
(テキストファイルで上手くいくか分かりません。)
ちなみに、管理画面上ではこのファイルは編集出来ないので、ローカル上で作業。
376行目以降の、以下のコードを書き換え。
function otf_commentlink($option_key, $result, $ext) {
$ttl = otf_commenter($option_key, $result, '');
$ttl = '<span class="rc-commenter">' . $ttl . '</span>';
if (!$ext) $ext = ' commented on ';
$ttl .= $ext;
$ttl .= '<span class="rc-title">'.otf_title($option_key, $result, '').'</span>';
$pml = otf_commenturl($option_key, $result, '');
$pdt = oth_format_date($result->comment_date_gmt, '');
$pdt .= __(' at ', 'post_plugin_library');
$pdt .= oth_format_time($result->comment_date_gmt, '');
return "<a href="$pml" rel="bookmark" title="$pdt">$ttl</a>";
}
↓
function otf_commentlink($option_key, $result, $ext) {
// $ttl = otf_commenter($option_key, $result, '');
// $ttl = '<span class="rc-commenter">' . $ttl . '</span>';
// if (!$ext) $ext = ' commented on ';
// $ttl .= $ext;
$ttl .= '<span class="rc-title">'.otf_title($option_key, $result, '').'</span>';
$pml = otf_commenturl($option_key, $result, '');
$pdt = oth_format_date($result->comment_date_gmt, '');
$pdt .= __(' at ', 'post_plugin_library');
$pdt .= oth_format_time($result->comment_date_gmt, '');
return "<a href="$pml" rel="bookmark" title="$pdt">$ttl</a>";
}
『//』 の部分をコメントアウトするだけで上手くいった。
後は微々たる問題点解決。
■サイドバーのコメント (リンク貼ってる部分) の下に、投稿者の名前を入れたい。
管理画面の 『設定』 → 『Recent Comments』 → 『Output』 を開く。
『Output template:』 の表示がデフォルトだと、以下のようになってると思います。
<li>{commentlink}</li>
これを、以下のように変更。
<li>{commentlink}</li>
<li>{author}</li>
私は以下のように設定してます。
<li>{commentlink}</li>
<li style="margin:0 0 5px; line-height:0.8em; border-bottom:solid 1px #d5d5d5;"> ⇒ {author}</li>
■単独ページの下に 『Recent Comments:』 が表示されるのを削除。
管理画面の 『設定』 → 『Recent Comments』 → 『Placement』 を開く。
『Output after post:』 を 『No』 にする。
・・・これはデフォルトで 『No』 になってるのかな?
色々いじった後で書いてるもんで、忘れました・・・。(^^;
■サイドバーの 『Recent Comments』 を日本語表示にする。
管理画面の 『デザイン』 → 『ウィジェット』 の 『現在のウィジェット』 から変更できます。
後はサイドバーに 『コメント』 と 『トラックバック』 を分けて表示させたいなぁ・・・と思っています。
WordPressの仕様上、この2つは同じ扱いになるようです。
また時間のある時に色々探してみよう。
■追記 (2008/12/13)
『
{author}』 だと自分になってしまうので、投稿者は以下の設定になります。
<li>{commentlink}</li>
<li style="margin:0 0 5px; line-height:0.8em; border-bottom:solid 1px #d5d5d5;"> ⇒ {commenter}</li>