Just some additional info for the main comment query:
Since you mentioned the global $wp_query
object, we can see that it stores:
$wp_query->max_num_comment_pages = $comment_query->max_num_pages;
in the main comment query in the comments template.
There exists a wrapper for this, namely:
get_comment_pages_count();
that’s available after the main comment query.
If we need it before the main comment query runs, then we might check if
get_comments_number( $post_id )
is greater than get_option( 'comments_per_page' )
. But we should keep in mind that the comments_per_page
parameter can be modified through e.g. the comments_template_query_args
filter.
Related Posts:
- Add “last” and “first” to WordPress Comment Pagination Links
- Modify previous and next text from pagination links
- Getting paginate_links() ‘end_size’ to display none
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- Display user’s total comment count outside The Loop
- Facebook Comment Count
- How to output a permanently delete comment link?
- Rewriting search and pagination base
- count number of user comments with a specific comment meta value
- Change comments form title on a page by page basis
- Changing Link Attributes for Wp_Link_Pages
- Custom Loop Pagination on WordPress
- How do I make wordpress comment fields required?
- How do I create comment-reply-button using element not
- Edit format of Paginate_Links()
- get understrap pagination to work with custom query
- Notify WordPress Site I Have Linked To Them
- Customized title tag for each page in pagination?
- Replace comment avatars and links at the same time
- Automatically generate Post/Page from searched Database item?
- Adding ads code between comments
- Page navigation not showing even tho it should
- comments_number display outside specified span
- Trying to implement Ajax comments in WordPress, getting WP error
- How does this WordPress Plugin (Thrive Comments) apply their custom comment sort? [closed]
- WP-PageNavi is showing the first page only
- How can I properly control the numbers and dots that appear in pagination?
- “comments.php” not available after edit in WP administration
- User’s total comment count excluding comments on their own posts
- WordPress 3.2 query_posts and pagination, permalinks issue
- Why does my callback function not work with this custom filter hook?
- How to implement a rating and review system for WordPress custom posts?
- Ajax load more button for comments wordpress
- Search not showing all results
- Create Page To Count Comments For Each Post In WordPress Site
- comments sorting incorrectly across multiple pages
- Commenting out unwated CSS/scripts in HTML with PHP
- Pagination in plugin’s backend
- wp-comments-post.php file returns a blank page
- php function to display commenter username or login
- check if comment submitted was successful
- Pagination for custom shop loop woocommerce
- Alter required message using comment form api
- Get post id within comments loop
- Custom Pagination is Broken
- WordPress comment submit button substitutes/options
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Prev/Next Links Broken on Static Front Page Pagination
- get comment data using comment id
- Removing the comment function within wordpress
- the_posts_pagination() not working in wpquery
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- Generating rel=”prev” and rel=”next” using filters
- Need help with Code Correction php+wordpress
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- Fetching Initials of the Commentator in the WordPress Website
- Need help with pagination
- get_comments_number() returns 0
- How can I include the user id inside of a shortcode php output?
- Conditionally load class in the comment section of the post page
- How to get comment_ID by post_ID in wordpress
- pagination broken – clicking next displays “page not found”
- Comment_author_url doing nothing
- Fatal error: Cannot redeclare comment_theme()
- Pagination Not Working (pages duplicating content)
- Pagination at category doesnt work with same name of page
- How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Show all people who commented on all posts by an author
- Commenting requires wordpress login, wordpress discussion and post comments tick boxes are checked
- Trying to get pagination working on WP_Query() post grid
- Comments on my custom post type
- Fetch commens from a specific post
- Closing Comments conditionally in comments.php
- Pagination 404 error(I have refreshed the permalinks and tried several previous options)
- Following/Followers Users list Using Ajax Pagination inside Author Profile
- WordPress Single Post Pagination Numbered and Navigational
- Add a leading zero to pagination
- Real time notification on user profile after new comment
- How can I output the slug of a comment author?
- How can I enqueue comment-reply script only on certain page?
- rewrite_rule – working fine but broken for pagination
- Getting most popular posts based on Facebook comments count
- How to fix blank pagination links?
- WordPress pagination broken on blog page, working for search results page
- A Space being added to url generated by custom plugin
- WordPress – show number of comments for each post in widget
- Pagination on Custom Loop
- How does add_action ‘comment_post’ work?
- Custom action on comment post
- WordPress most commented posts of last X days
- How do I call comments_template(); from a plugin file?
- WordPress post pagination on custom template not working
- How to convert my comment.html to comment.php
- How to add pagination for wordpress home page
- Pagination 404 on my index.php
- Infinite Scroll Plugin: How to first show 6 posts and then 2 posts thereafter with Infinite Scroll Plugin?
- /page/2/ redirect to 404
- Permissions error when I use my plugin to delete comments in the front-end
- Why do I get a 404 error on my custom post type archive pagination?