WordPress.org

Ready to get started?Download WordPress

Forums

Next Page split post question (9 posts)

  1. Andrei
    Member
    Posted 3 years ago #

    Hello everyone,

    I wonder if anybody has been using the <!--nextpage--> tag to split posts in custom installations of WP.

    I have tried using this tag that I found in the WP docs to create pagination inside a post, but so far it does nothing whatsoever. Initially I thought it might be the fault of the theme I was using, but switching to the default WP theme didn't help the situation. I have also tried to create a simple page for the single post where I could use the wp_link_pages function, but again to no result.

    Could anyone offer some suggestions to what I need to do to use this tag (or obtain pagination within a post) ?

    Thanks!

  2. keesiemeijer
    moderator
    Posted 3 years ago #

    Did you use the html-mode of the editor to insert the <!--nextpage--> tag?

    Do you use wp_link_pages within The Loop?

    http://codex.wordpress.org/Styling_Page-Links

  3. Andrei
    Member
    Posted 3 years ago #

    Hi keesiemeijer, thanks for the reply.

    yes, I used the html editor to add the tag (otherwise it would've displayed the tag itself as text within the post). I even checked the database entry with phpMyAdmin to make sure the tag was correctly written and not encoded in some way.

    I don't use wp_link_pages within The Loop, there's no need for that. wp_link_pages is meant (as the codex says) to be used for a single post. As such, I used it on the single.php page, which displays a single post (not the post while looping through the list of posts) so there's nothing to loop through.

  4. keesiemeijer
    moderator
    Posted 3 years ago #

    http://codex.wordpress.org/Template_Tags/wp_link_pages

    "This tag must be within The_Loop."

  5. Andrei
    Member
    Posted 3 years ago #

    Hmmm, in this case I suspect the tag is useless to me. I need to use it on the single.php template page, which stands outside the loop. Displaying page links for the same post inside The Loop doesn't help me.

    Have you used this function/tag before?

  6. kmessinger
    Volunteer Moderator
    Posted 3 years ago #

    Why not use <!--more-->

  7. Andrei
    Member
    Posted 3 years ago #

    Hi kmessinger

    I am using !--more-- to make the list of posts (displaying a "teaser" of each post). But "more" only splits a post in 2, I need to split a single post in several pages which should then be listed individually (page 1, 2, 3, etc).

  8. keesiemeijer
    moderator
    Posted 3 years ago #

    I need to use it on the single.php template page, which stands outside the loop.

    What do you mean by this? You can loop through a list which contains only 1 Post. Maybe you need to create a loop for your single.php file?

  9. austerus
    Member
    Posted 3 years ago #

    Hello again & thanks for the suggestion,

    Took a while to go through the code but as it looks, the single.php file is itself inside a loop that goes around for one post. However, the function still produces nothing.

Topic Closed

This topic has been closed to new replies.

About this Topic