ページャー
//////////////////////////
// for single.php
//////////////////////////
// 1.
<?php posts_nav_link(); ?>
// 2.
<?php previous_posts_link('<<前のページ'); ?>
<?php next_posts_link('次のページ >>'); ?>
// 3.
<?php previous_posts_link("%link",'<img src="" />') ?>
<?php next_post_link("%link",'<img src="" />') ?>
//////////////////////////
// for single-xxx.php
//////////////////////////
// Next/Previous Post Link Plus for WordPress
// http://www.ambrosite.com/plugins/next-previous-post-link-plus-for-wordpress
<?php previous_post_link_plus(array('format' => '%link', 'link' => '<img src="画像パス">', 'in_same_tax' => true)); ?>
<?php next_post_link_plus(array('format' => '%link', 'link' => '<img src="画像パス">', 'in_same_tax' => true)); ?>
// リンクがない場合にもイメージを出したい。
<ul>
<li>
<?php if(!previous_post_link_plus(array('format' => '%link', 'link' => '<img src="/img/common/btn-prev.png" alt="PREV" width="55" height="20">', 'in_same_tax' => true )) ):
?>
<img src="/img/common/btn-prev.png" alt="PREV" width="55" height="20" class="disable">
<?php endif; ?>
</li>
<li class="add-bor"><a href=""><img src="/img/common/btn-index.png" alt="INDEX" width="81" height="20"></a></li>
<li>
<?php if(!next_post_link_plus(array('format' => '%link', 'link' => '<img src="/img/common/btn-next.png" alt="NEXT" width="55" height="20">', 'in_same_tax' => true )) ):
?>
<img src="/img/common/btn-next.png" alt="NEXT" width="55" height="20" class="disable">
<?php endif; ?>
</li>
</ul>
// !小カテゴリー内でページングしたい場合はin_catsを使うといい感じ
// 'in_cats' => $cat_id
single.php
<div class="pager">
<div class="btn-morelist"><a href="/careerblog/">一覧へ戻る</a></div>
<ul class="clearfix">
<li id="btn-prev">
<?php if (get_previous_post()):?>
<?php previous_post_link('%link','PREV',TRUE); ?>
<?php else: ?>
<span>PREV</span>
<?php endif; ?>
</li>
<li id="btn-next">
<?php if (get_next_post()):?>
<?php next_post_link('%link','NEXT',TRUE); ?>
<?php else: ?>
<span>NEXT</span>
<?php endif; ?>
</li>
</ul>
</div><!-- / .pager -->
index.php
<div class="pager">
<ul class="clearfix">
<li id="btn-prev">
<?php if( $prev_link_tag = get_previous_posts_link() ):?>
<?php previous_posts_link('PREV');?>
<?php else: ?>
<span>PREV</span>
<?php endif;?>
</li>
<li id="btn-next">
<?php if( $next_link_tag = get_next_posts_link() ):?>
<?php next_posts_link('NEXT');?>
<?php else: ?>
<span>NEXT</span>
<?php endif;?>
</li>
</ul>
</div><!-- / .pager -->
// < 1 2 3 4 5 > 型
<?php if( $wp_query->max_num_pages > 1): ?>
<nav id="pager">
<ul class="page_navi">
<?php global $wp_rewrite;
$paginate_base = get_pagenum_link(1);
if(strpos($paginate_base, '?') || ! $wp_rewrite->using_permalinks()){
$paginate_format = '';
$paginate_base = add_query_arg('paged','%#%');
}
else{
$paginate_format = (substr($paginate_base,-1,1) == '/' ? '' : '/') .
user_trailingslashit('page/%#%/','paged');;
$paginate_base .= '%_%';
}
echo paginate_links(array(
'base' => $paginate_base,
'format' => $paginate_format,
'total' => $wp_query->max_num_pages,
'mid_size' => 4,
'current' => ($paged ? $paged : 1),
'prev_text' => '<img src="/img/news/arr-pager_prev.png" alt="PREV" width="6" height="11">',
'next_text' => '<img src="/img/news/arr-pager_next.png" alt="NEXT" width="6" height="11">',
'type' => 'plain'
)); ?>
</ul>
</nav>
<?php endif; ?>