Site logo

Archived topic

Label pagination

1 reply · Started by Kevin on January 5, 2021

Viewing posts 1–2 of 2

I'm trying to change the text written on the Next Page and Previous Page buttons on the article's pagination. (Pages of the same article).

I currently use this code, but I don't know which argument to put to change the Next Page and Previous Page texts Label.

add_filter( 'wp_link_pages_args', 'lh_wp_link_pages' );
function lh_wp_link_pages( $args ) {
$args['next_or_number'] = 'next';
$args['before'] = '<p class="custom-next-previous"><span class="wp-block-button aligncenter">';
$args['after'] = '</p>';
$args['separator'] = '</span><br><span class="wp-block-button aligncenter">';
$args['link_before'] = '';
$args['link_after'] = '</span>';
$args['generate_next_link_text'] = 'Proximo';
$args['generate_previous_link_text'] = 'Anterior';
return $args;

}

Hi there,

According to the core code, this should do it:

add_filter( 'wp_link_pages_args', function( $args ) {
    $args['nextpagelink'] = 'Next';
    $args['previouspagelink'] = 'Previous';

    return $args;
} );
This archived topic is closed to new replies.