$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>pagination - How to get "nexepagelink" and "previoiuspagelink" in wp_link_pages?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin11PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far