Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Modifying pagination for multi-page posts

Discussion in 'Misc WordPress Requests' started by w9202, Mar 4, 2018.

  1. w9202

    Guest

    Reply To: Modifying pagination for multi-page posts, by w9202

    I put the function below into the child theme ‘functions.php’:


    function child_mts_wp_link_pages_args( $args ) {
    global $page, $numpages, $more, $pagenow;

    $args['before'] = ' ';
    $args['after'] = '</div>';
    //$args['link_before'] = '<span class="page-link">';
    $args['link_before'] = '<span class="current"> <span class="currenttext">';
    $args['link_after'] = '</span> </span> <br> <br>';
    $args['next_or_number'] = 'next';
    $args['separator'] = ' ';
    $args['previouspagelink'] = ' ';
    $args['nextpagelink'] = __( 'Continue' , 'textdomain' );

    return $args;

    }
    add_filter( 'wp_link_pages_args', 'child_mts_wp_link_pages_args', 15 );


    The parent theme’s function wasn’t pluggable so I assigned this new filter a priority of 15 (WordPress default is 10) so that this one will run after the parent one and override it.

    This got it working. Thanks for the help, I’m new to wordpress and just didn’t know that wp_link_pages was where the code was for this stuff.

    Reply To: Modifying pagination for multi-page posts
     
    #1

Share This Page

Monarch Social Sharing Plugin