WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Does nextpage tag insert a “Read More” link on index.php?

[Resolved] Does nextpage tag insert a “Read More” link on index.php?

  • I’ve been searching for quite some time now, and I can’t even find an answer to this question, let alone a workaround for it.

    When using the nextpage tag, the main “posts” page (index.php) only shows the post content that is before the first nextpage tag, which is expected. However, unlike the more tag, there is no “Read the rest of this entry” link inserted after that chunk of the post.

    I am using <?php the_content('Read the rest of this entry &raquo;'); ?> to display the posts on index.php, so the link to read more on a post should be there automatically. If I use the more tag, it works as expected.

    My question is this: Is the nextpage tag supposed to trigger that automatic “Read More” link? If it is supposed to, then what other code do I need to insert to make it show up?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    @esmi

    Forum Moderator

    Is the nextpage tag supposed to trigger that automatic “Read More” link?

    No – it’s supposed to trigger a list of secondary page links – eg:

    Pages: 1 2 3 4

    You need to look at adding the wp_link_pages tag to your theme templates.

    Hi Esmi,

    Thanks for your quick reply. I am using wp_link_pages() on single.php but not within the loop on index.php. I do get the numbered page links when viewing the single post.

    On the home page, index.php, I need to know if the_content('Read the rest of this entry &raquo;'); will print that “Read More” link for paged posts as well as posts with the more tag.

    esmi

    @esmi

    Forum Moderator

    Yes it will.

    If it’s supposed to print that link, I don’t know what I’m doing wrong. I am not getting a “Read More” link on that post when I’m on the home page. I thought it was my code, so I switched to the default theme (Kubrick) and I’m still not seeing a link.

    On the home page in both themes, I do get a “Read More” link when I use the more tag, just not on the paginated post.

    Do I need to insert a more tag right before my first nextpage tag to get the link to show up? Right now, that’s the only thing that makes it work.

    esmi

    @esmi

    Forum Moderator

    Sorry – yes. You still need to insert the <!--more--tag--> to generate the Read more link. The post pagination links will be generated wherever the template uses wp_list_pages. Personally, I tend to place this tag just after the_content() block but it’s conceivable that some authors might place it nearer the top of a post.

    Thanks so much for your help!

    I have made a lot of themes in the past couple of years, but this is the first time I went through every item in the Theme Development Checklist to make sure I covered all my bases. Paginated posts was just a base I had never covered before!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Does nextpage tag insert a “Read More” link on index.php?’ is closed to new replies.
Skip to toolbar