WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

You can do a multipage post by using the <!--nextpage--> inside the post. The question is:

How can I display the whole post (not paged) for this post.

share|improve this question
up vote 1 down vote accepted

Well, you can turn it off completely or use the following code along with some sort of conditional statement to switch it on or off.

The multipage part is set up in the setup_postdata() function in wp-includes/query.php. There's an action at the end of the function called the_post.

If you hook onto that and then modify the globals that are set up in the function you can undo the multipage config:

add_action( 'the_post', function( $post ) {
    global $pages, $numpages, $multipage;
    $pages = array( implode( '', $pages ) );
    $numpages = 1;
    $multipage = 0;
} );

Add that to your functions.php or plugin and you're good to go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.