1

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.

1 Answer 1

7

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.
}
?>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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