我正在尝试更改WP的分页,以便它只显示上一个和/或下一个按钮,而不显示中间的页面。
使用Codex中的以下代码片段:
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
\'base\' => str_replace( $big, \'%#%\', esc_url( get_pagenum_link( $big ) ) ),
\'format\' => \'?paged=%#%\',
\'current\' => max( 1, get_query_var(\'paged\') ),
\'total\' => $wp_query->max_num_pages
) );
?>
以及这些参数:
<?php $args = array(
\'base\' => \'%_%\',
\'format\' => \'?page=%#%\',
\'total\' => 1,
\'current\' => 0,
\'show_all\' => False,
\'end_size\' => 1,
\'mid_size\' => 2,
\'prev_next\' => True,
\'prev_text\' => __(\'« Previous\'),
\'next_text\' => __(\'Next »\'),
\'type\' => \'plain\',
\'add_args\' => False,
\'add_fragment\' => \'\'
); ?>
但我做不好!它始终显示:
1 2 next or previous 1 2
我想知道:
next previous
这可以通过改变参数来实现吗?