how to know if the post has pagination () 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.


1 Answer

Just check for the global $numpages variable:

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

Leave a Comment