WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Does nextpage tag insert a "Read More" link on index.php? (7 posts)

  1. Alison Barrett
    Member
    Posted 4 years ago #

    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!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    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.

  3. Alison Barrett
    Member
    Posted 4 years ago #

    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.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    Yes it will.

  5. Alison Barrett
    Member
    Posted 4 years ago #

    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.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    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.

  7. Alison Barrett
    Member
    Posted 4 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic