Forums

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

  1. aliso
    Member
    Posted 1 month 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
    Member
    Posted 1 month 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. aliso
    Member
    Posted 1 month 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
    Member
    Posted 1 month ago #

    Yes it will.

  5. aliso
    Member
    Posted 1 month 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
    Member
    Posted 1 month 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. aliso
    Member
    Posted 1 month 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!

Reply

You must log in to post.

About this Topic