[Support request] Label pagination

Home Forums Support [Support request] Label pagination

Home Forums Support Label pagination

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1606810
    Kevin

    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;

    }

    #1607144
    Tom
    Lead Developer
    Lead Developer

    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;
    } );
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.