1

I'm trying to get pagination in my pages, so I use this default option:

<?php wp_link_pages( array(
    'before'           => '<div>',
    'after'            => '</div>',
    'link_before'      => '<span class="page-numbers">',
    'link_after'       => '</span>',
    'next_or_number'   => 'number',
    'separator'        => ' ',
    'nextpagelink'     => __( 'Next page', 'behold-universal-one'),
    'previouspagelink' => __( 'Previous page', 'behold-universal-one' ),
)); ?>

works all except "nextpagelink" and "previouspagelink". No matter what I use, no text next or previus pages is visible. Ofcourse there is more than one page break. Wordpress 5.1

Any ideas why?

0

1 Answer 1

1

wp_link_pages() doesn't support numbers and next/previous links. If you set next_or_number to number, the default, then the pages will be shown as number links. By default that looks like this:

Pages: 1 2 3

If you set it to next then you'll get this output:

Pages:Previous page Next page

The nextpagelink and previouspagelink arguments are used to changed those labels, but they won't add next and previous links to the numbered pagination.

3
  • I see. I suggested archive pagination where except numbers I can get nav arrows before and after. So, in pages pagination via wp_link_pages can't do that, right?
    – Damian
    Feb 25, 2019 at 1:29
  • Correct. The pagination used for archives does support this, but not pagination for page content. Feb 25, 2019 at 1:31
  • Thanks, that's another time when your answer is clear and very usefull!
    – Damian
    Feb 25, 2019 at 1:31

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.