The easiest thing to do is to wrap the code that displays the comments in a conditional like this:
if ($page === $numpages) {
echo 'last page'; // this is the last of the <!--nextpage--> pages
}
That requires a theme edit, so it is only a good solution if this is a theme you’ve constructed and maintain.
The variables (global
) $page
and $numpages
are set by setup_postdata()
and so should be reliable inside any properly constructed Loop.
Related Posts:
- Paginate result set from $wpdb->get_results()
- Reverse comment pagination numbers
- Is there any way to override “break comments into pages” and “close comments for old posts” on certain posts, but not on others?
- How to no follow the paginated comments
- Comments Pagination as an unordered list
- How to add pagination to comments?
- Comment pagination – How to show determined number of comments on the first page?
- changing comment-page-# to something like review-page-#
- Redirect to page 2 after comment
- Set noindex page-comment from Pages 2, 3 and More?
- Pagination Comments Doesn’t Show
- PAIN. Comments Pagination
- assumed as comment line
- Comment Pagination
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- Comments pagination: reverse JUST the links texts (1-2-3 to 3-2-1), not comments order
- What is wrong with this? [closed]
- Comments pagination on author page
- Comment submission & navigation redirects to default language
- If paginated comments don’t span to a second page, how do I hide the div wrapper?
- WordPress comment pagination : newest comments on first page
- Pagination comments
- Remove “#comments” from comments pagination url
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- How to enable comments for pending and draft posts?
- Comments not appearing at all
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Comment Count for each Comment Author
- Show comments from multiple post IDs in comment template
- Sticky Comments
- Whitelisting Commenters
- Comments number message in password protected post
- Disable Comments Feed
- Use rich text editor in comments?
- Add a custom class to awating comments
- How to add custom comment fields but *only on the comment reply form*?
- Show only posts which can be commented
- What should I hook to add extra fields to comments?
- Get a variable field of all comments of current post
- Average Score of all ratings in comments
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, func
- How To Disable Comments On New Page
- What is the server IP comment hack
- Do I have to have a nonce for a custom comment field?
- Report spam button
- Recent comments from my blogs only
- Disable or Enable Comments on Front end [closed]
- Change username to nickname in comment section
- Reject Comments Based on Author Email
- Turning off trackbacks & comments
- Create comments.php form of custom HTML code
- Disqus comments and pingback script – how to change the order?
- To whom do emails get sent via the WordPress comments form?
- Is it possible to embed github gists in wordpress comments?
- Comments feed – Undefined named entity: ndash
- warnCommentChanges always being triggered on update
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- Why do I have to manually approve comments from one of my users who already has an approved comment?
- how get comments only on post of current logged in user?
- Customizing Comments on Posts
- How to convert WordPress comments to bbPress replies [closed]
- Get declared variable in single.php to work in comments.php without re-declaring it [closed]
- What is causing wp-comments-post.php to redirect to the browser’s IP address?
- Extra Title field for Comments
- Comments offset
- comments_number not displaying
- Get comments only for certain specific users in template file
- Insert Ads “into” comments section in Genesis Themework
- WordPress Recent Comments Widget exclude own comments
- How to get comment images stored as serialized comment meta
- Hide comments on specific pages, not just disable future comments
- How to permanently delete pages I have already trashed?
- Additional content every x comments
- How to display category name from commenter’s custom post
- Add comment_meta to wp_comment_reply
- How do comments work?
- What’s the difference with trash_comment and wp_trash_comment?
- How can i change the order of comments?
- ask and edit an extra comment field
- Refresh individual comment text via API
- How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?
- Need to output comment_form() function inside a foreach loop
- Comment field override
-   not working in comments
- Badges for Guests based on their comment counts [closed]
- How to add a class to comment submit button?
- WordPress Comments – Only show part of user name
- URLs to user page is broken
- Comments Template shows, but not the comments
- Broken comments section – WordPress 2014 Theme
- Need an advice about comments
- Force logged in users to provide more data when commenting
- How do I get the comments section to show up?
- By Default, Turn Comments Off for Pages & Leave Comments On for Posts
- same comment list for two posts
- Getting thousands of spam comments
- edit-comments.php in Admin – how to change ‘Comments’ title?
- Stop future commenting on specific post
- WordPress Editor widgets “comments” and “post comments form” getting disappeared with elementor [closed]