For multi-page posts:
- The
$page
global variable returns the current page of a multi-page post. - The
$numpages
global variable returns the total number of pages in a multi-page post.
For paginated archive index pages:
- The
$paged
global variable returns the current page number of a paginated archive index.
To use any of these variables, simply globalize them first:
global $page;
echo 'The current page number of this post is ' . $page . '.';