WordPress.org

Support

Support » Themes and Templates » [Resolved] Find out the last part of a page/post

[Resolved] Find out the last part of a page/post

  • Greetings

    I’m currently doing a template for a page

    the content of my page is splited in different page’s parts with <!nextpage>, I’m using wp_link_pages to paginate/navigate within the page’s parts.

    I try to find out when I’m on the last part from the page split, so that I can make appear a special text..

    in some other words, I try to find out how many parts exist so that I can know where I’m.

    I know the variable $page, this is fine to know in which part I’m currently but not if that’s the last one

    I’ve deeply searched the codex, but I have not been very successful on this one..

    maybe one of you guys have some hints?

    thank you in advance

    kisses

    Steffy

Viewing 3 replies - 1 through 3 (of 3 total)
  • (in the loop)
    the variable $numpages holds the number of split page parts;

    and the variable $page holds the number of the actual subpage.

    example:
    <?php if($numpages > 1) echo 'you are on subpage '.$page.' of '.$numpages.' subpages'; ?>

    Alchymyth you rock !!!!

    you saved my day, I was not aware of the numpage variable, you truly rock !!!

    Thank you again very very much

    Yes, thanks for the info! It really did help me! 😀

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Find out the last part of a page/post’ is closed to new replies.
Skip to toolbar