我正在使用wordpress。 我想将文章分成几部分,所以我使用Page Break选项。但它显示页面分页!我想只显示Prev和Nex butons。 这是被调用函数的代码
function mts_wp_link_pages_args( $args ) {
global $page, $numpages, $more, $pagenow;
if ( !$args['next_or_number'] == 'next_and_number' )
return $args;
$args['next_or_number'] = 'number';
if ( !$more )
return $args;
if( $page-1 )
$args['before'] .= _wp_link_page( $page-1 )
. $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '</a>'
;
if ( $page<$numpages )
$args['after'] = _wp_link_page( $page+1 )
. $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '</a>'
. $args['after']
;
return $args;
}
add_filter( 'wp_link_pages_args', 'mts_wp_link_pages_args' );
这个功能被称为:
<?php wp_link_pages(array('before' => '<div class="pagination">', 'after' => '</div>', 'link_before' => '<span class="current"><span class="currenttext">', 'link_after' => '</span></span>', 'next_or_number' => 'next_and_number', 'nextpagelink' => __('Next','mythemeshop'), 'previouspagelink' => __('Previous','mythemeshop'), 'pagelink' => '%','echo' => 1 )); ?>
答案 0 :(得分:0)
您可以使用不输出页码的next_posts_link
和previous_posts_link
链接到下一页的帖子。
<div class="pagination">
<span class="current"><span class="currenttext"><?php next_posts_link(esc_html__('Next','mythemeshop')); ?><</span></span>
<span class="current"><span class="currenttext"><?php previous_posts_link(esc_html__('Previous', 'mythemeshop')); ?></span></span>
</div>