PageNaviの設定方法:
既存の ← 過去の投稿 | 新しい投稿 → というリンクをページヘのリンクで置き換え方法
This plugin provides the wp_pagenavi()
template tag which generates fancy pagination links.
使い方
In your theme, you need to find calls to next_posts_link() and previous_posts_link() and replace them.
Twentyten テーマでは、(loop.php内)の下記の部分を書き換えるようにとのこと。
(※書き換えなくても、実際はこの下に追加すれば、PageNaviが表示される)
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
You would replace those two lines with this:
<?php wp_pagenavi(); ?>
For multipart pages, you would look for code like this:
<?php wp_link_pages( ... ); ?>
and replace it with this:
<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
Go to WP-Admin -> Settings -> PageNavi for configuration.
HomeAtomoでの変更記録:
Twenty-tenのloop.phpの最下段にある以下のDisplayNaviの記述に、赤字を追加
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id=”nav-below” class=”navigation”>
<div class=”nav-previous”><?php next_posts_link( __( ‘<span class=”meta-nav”>←</span> Older posts’, ‘twentyten’ ) ); ?></div>
<div class=”nav-next”><?php previous_posts_link( __( ‘Newer posts <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?></div>
</div><!– #nav-below –>
<?php endif; ?>
<?php wp_pagenavi(); ?>