pagination - How to get "nexepagelink" and "previoiuspagelink" in wp_link_pages?

admin2025-06-02  4

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?

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?

Share Improve this question asked Feb 25, 2019 at 1:09 DamianDamian 971 gold badge1 silver badge11 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748870379a314405.html

最新回复(0)