interesting idea.
took a few steps to do it:
1. let wordpress use a parameter in the url:
thanks to this article:
https://www.webopius.com/content/137/using-custom-url-parameters-in-wordpress
– add this to functions.php of the theme:
/* pass Parameter with url
Plugin URI: https://webopius.com/
Description: A plugin to allow parameters to be passed in the URL and recognized by WordPress
Author: Adam Boyse
Version: 1.0
Author URI: https://www.webopius.com/
*/
add_filter('query_vars', 'parameter_queryvars' );
function parameter_queryvars( $qvars )
{
$qvars[] = 'all';
return $qvars;
}
2. use this parameter to switch to full post content:
– to show the full content despite the <!--nextpage-->
tags, you would use:
echo apply_filters('the_content',$post->post_content);
instead of the_content();
– use the paramter from the url to recognize if the full post is to be shown:
global $wp_query;
if (isset($wp_query->query_vars['all']))
{ $no_pagination = $wp_query->query_vars['all']; } ;
– show the full post or the paginated parts, dependant on the variable:
if($no_pagination) { echo apply_filters('the_content',$post->post_content); $page=$numpages+1; } else { the_content(''); };
($page=$numpages+1;
tricks ‘wp_link_pages’ to show all links.)
3. change the ‘wp_link_pages’ to include a ‘all’ choice:
<?php $page_links = wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number', 'echo' => '0' ));
$page_links = str_replace('</p>','<a href="'.get_permalink().'?all=1"> all</a></p>',$page_links); echo $page_links; ?>
hope this helps, good luck ??