WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Get current page number for paginated posts (4 posts)

  1. Scott Bressler
    Member
    Posted 4 years ago #

    I'm trying to get the current page and the total number of pages for paginated posts, but the only method I see that works toward that is wp_link_pages, and that's not enough for what I want. Is there some other method that will help me print out at the top of page 2 for a paginated post, (Page 2 of 2)?

    Thanks!

  2. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    <?php echo '(Page '.$page.' of '.$numpages.')'; ?>

    the global variables $page and $numpages are used in here:
    http://phpxref.com/xref/wordpress/wp-includes/post-template.php.source.html#l528

  3. Scott Bressler
    Member
    Posted 4 years ago #

    Thanks for the quick response! Nice catch - didn't notice those variables.

  4. Daniele Raimondi
    Member
    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic