0

I got this:

$pagination_args = array(
    'base'            => '%_%',
    'format'          => '?listpostspage=%#%',
    'total'           => $the_query->max_num_pages,
    'current'         => $paged,
    'show_all'        => false,
    'end_size'        => 1,
    'mid_size'        => 2,
    'prev_next'       => true,
    'prev_text'       => __( 'Zurück', 'Theme' ),
    'next_text'       => __( 'Weiter', 'Theme' ),
    'type'            => 'plain',
    'add_args'        => false,
    'add_fragment'    => ''
);

Strangely the page 1 link is always the page im currently on? What is wrong?

2
  • Found the answer to this question here.
    – GDY
    Commented May 19, 2016 at 13:24
  • If you had figured out your issue you might want to post it in detail as an answer so that others can benefit. :)
    – Rarst
    Commented May 19, 2016 at 14:13

1 Answer 1

0

The Base is the Problem:

'base' => add_query_arg('listpostspage','%#%'),

Here ist the full code:

$pagination_args = array(
    'base'            => add_query_arg('listpostspage','%#%'),
    'format'          => '?listpostspage=%#%',
    'total'           => $the_query->max_num_pages,
    'current'         => $paged,
    'show_all'        => false,
    'end_size'        => 1,
    'mid_size'        => 2,
    'prev_next'       => true,
    'prev_text'       => __( 'Zurück', 'Theme' ),
    'next_text'       => __( 'Weiter', 'Theme' ),
    'type'            => 'plain',
    'add_args'        => false,
    'add_fragment'    => ''
);

Thanks goes to raison over at stackoverflow who posted this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.