WordPressを利用して作成した「めるちる」の備忘録兼ショッピング用情報サイトです。
「more」タグをカスタマイズする方法は前に記述したが
『ファビコンの設置、more画像のカスタマイズ方法』
投稿時に手入力で「more」タグを挿入した場合には上記のカスタマイズ方法で解決するが、
「WP Multibyte Patch」で抜粋表示しているので、 functions.phpファイル内で修正した。
今までは可愛い
を右揃えで使用していたが、もう少し大人っぽくスッキリとさせたくて、
抜粋文字のすぐ後ろに、色を変えて「続きを読む」というテキスト表示に変更した。
修正した functions.phpファイルの内容は以下の通り
【修正前】
/*new_excerpt_more*/
function new_excerpt_more($more) {return ‘ <a href=”‘. get_permalink() . ‘”>more</a>’;
}add_filter(‘excerpt_more’, ‘new_excerpt_more’);
【修正後】
/*new_excerpt_more*/
function new_excerpt_more($more) {return ‘ <a href=”‘. get_permalink() . ‘”><font color=”red”>続きを読む</font></a>’;
}add_filter(‘excerpt_more’, ‘new_excerpt_more’);
いかがでしょうか?