wordpress 投稿の抜粋を表示で “read more”リンク作成
2010.12.26
この記事は最終更新日から1年以上が経過しています。
wordpress テンプレートタグ the_excerpt()を使うと、[…]と最後に付くのを
記事へのリンクに変更する方法です。
至って簡単。
テーマの functions.phpに(ない場合は作成しましょう。)
(wordpress>wp-content>テーマ名>に配置)
function new_excerpt_more($post) { return '<a href="'. get_permalink($post->ID) . '">' . 'Read the Rest...' . '</a>'; } add_filter('excerpt_more', 'new_excerpt_more');
これでオッケー!
後はCSS等で調整を。