<div class="navigation"> <div class="alignleft"><?php previous_post_link('« %link') ?></div> <div class="alignright"><?php next_post_link('%link »') ?></div> </div> これって、全ポストを通じた日付順の前後が表示されるんですが、単純な日記コンテンツならいざ知らず、普通この手のナビゲーションって日付移動じゃなくて、同一カテゴリ内の移動が実用的ですよね。 これを実現するプラグインを探してみたんですが、WordPress関数で用意されてました。 <div class="alignleft"> <?php previous_post_link('« %link', '%title', TRUE, '')
カテゴリなら、category-1.phpとかでカテゴリごとのテンプレートを用意出来るが、単一投稿ページでsingle-1.phpは出来ない。なので、single.phpに <?php $post = $wp_query- >post; if ( in_category(‘1‘) ) { include(TEMPLATEPATH . ‘/single1.php‘); } elseif ( in_category(‘2‘) ) { include(TEMPLATEPATH . ‘/single2.php‘); } else { include(TEMPLATEPATH . ‘/single_other.php‘); } ? > などと書くと、属しているカテゴリごとに表示を変えられる。これ便利。
“My Category Order” is open source software. The following people have contributed to this plugin. Contributors froman118
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く