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