how to know if the post has pagination (<!–nextpage–>) or not

i need a solid solution for checking if a post has pagination or not, regardless of the number of current page in the pagination, and even if the post is in the first page of the pagination.
the check is inside the loop.

thanks.

Related posts

Leave a Reply

1 comment

  1. Just check for the global $numpages variable:

    <?php 
    global $numpages;
    if ( is_singular() && $numpages > 1 ) {
        // This is a single post
        // and has more than one page;
        // Do something.
    }
    ?>