• Hello,

    A client is using <!– nextpage –> to split up a post into multiple pages. She’s asked if there’s a way to reference the next page. That is, in addition to the “Pages 1 | 2 | 3 ” that is added, she wants a link that says “<Post Title> Continued here…”

    So, is there any way to add to a post something like:

    <a href="(php tag to next page of the post)">(php tag to post title) Continued here... </a>

    that would be typed in when a post is created in the dashboard?

    Thanks,
    Jason

Viewing 1 replies (of 1 total)
  • There’s no automatic way to add such a link as far as I know; however you could construct a code snippet for her to use as part of a copy/paste/edit process – provided she’s organised enough and disciplined enough to edit it correctly.

    The generic format for such a page link is

    <a href='https://bloginfo('url')/?page_ID=N&page=n'>your tag link</a>

    where

    bloginfo('url') is the root URL of the site

    N is the unique ID for the root page that holds the nextpage links

    n is the number of the required subpage [each nextpage break creates a new subpage]. The root page itself always has a subpage number of 1, so all subsequent sub-pages number from 2 upwards: you may need to know that to construct previous/next links correctly. In other words the root page would always be

    <a href='https://bloginfo('url')/?page_ID=N&page=1'>your tag link</a>

    You can extract the ID of a current root page with code using get_the_ID(); and the number of subpages in it using echo $numpages; or print_r $numpages; etc.

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Link to next page when using <nextpage> tag’ is closed to new replies.