Skip to main content
4 of 5
deleted 2 characters in body
birgire
  • 67.8k
  • 7
  • 119
  • 251

You can try to use the the_post filter, to override the content pagination, that takes place within the setup_postdata() function ( PHP 5.4+ ):

/**
 * Ignore the <!--nextpage--> for content pagination.
 * 
 * @see http://wordpress.stackexchange.com/a/183587/26350
 */

add_action( 'the_post', function( $post )
{
    if ( false !== strpos( $post->post_content, '<!--nextpage-->' ) ) 
    {
        // Reset the global $pages:
        $GLOBALS['pages']     = [ $post->post_content ];
        
        // Reset the global $numpages:
        $GLOBALS['numpages']  = 0;

       // Reset the global $multipage:
        $GLOBALS['multipage'] = false;
    }
    
}, 99 );

to ignore the <!--nextpage--> feature.

The wp_link_pages() function checks if the global $multipage is true to display the content pagination numbers.

birgire
  • 67.8k
  • 7
  • 119
  • 251