I'm trying to alter the pagination of WP so that it shows ONLY a Previous and/or Next button, and NOT the pages in between.
Using this snippet from the 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
) );
?>
And these parameters:
<?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' => ''
); ?>
But I can't get it right! It always shows: 1 2 next or previous 1 2
And I'm trying to get this: next previous
Can this be done by altering the parameters?
paginate_links
! What's the context? A post loop? A gallery? Is this in the front-end or admin?end_size
=> 0, andmid_size
=> 0 should solve it, if I understand you correctly (you use$args
var aspaginate_links
function argument?).next_posts_link()
&previous_posts_link()
?