WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Finding <!--nextpage--> in a post or page? (4 posts)

  1. L D
    Member
    Posted 4 years ago #

    Hello, I was wondering if it's possible to find out what page a post is on at any given time.

    For example, is it possible to call something like:

    [code]
    if(post_current_page() == 1) {
    // do something if we are on the first "page" of this particular post.
    } else if(post_current_page() == 2) {
    // do something else if we are on the second "page" of this particular post.
    }
    [/code]

    I've found that my post avatar is displaying at the beginning of EVERY page of a post that has been split up with <!--nextpage-->. I don't want that. I only want the thumbnail to show on the first page of a post that has been split up into several pages. Is that possible? How would I do that? Thanks!

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

    http://wordpress.org/support/topic/375092?replies=3

    $page holds the number of the (paginated) page.

  3. Jonas Grumby
    Member
    Posted 4 years ago #

    You can probably do something with Conditional Tags.

  4. L D
    Member
    Posted 4 years ago #

    Thank you both, it works! :D And for anyone else who's trying to figure it all out, here's another link that will shed some light on the mystery:

    http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/

Topic Closed

This topic has been closed to new replies.

About this Topic