Try get_comment_pages_count()
?
<?php get_comment_pages_count( $comments, $per_page, $threaded); ?>
I’m guessing you’re outside the loop, since you’re calling get_comments()
; in that case, you’ll need to pass your $comments
object:
$comments = get_comments(array(
'post_id' => $post_id,
'status' => 'approve'
));
wp_list_comments(array(
'page' => 1,
'per_page' => 10,
'avatar_size' => 16,
), $comments);
$comment_page_count = get_comment_pages_count( $comments );
Related Posts:
- Writing a plugin that notify my friends of new post that mentions(@) them
- Why are two functions over-riding each other?
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- comment_email hook doesn’t seem to work for comment editor field
- Paging on a future post loop?
- Show comments fields in two columns
- preprocess_comment array doesn’t have comment_ID
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- How to deal with equal & similar arguments for a function?
- Can wp_list_comments output into variable?
- Comments do not respect display_name setting, how to make plugin to overcome this
- Problem with parameters in url and pagination
- $reverse_top_level works the opposite way according to Codex?
- How to integrate CLEditor to comment system?
- Get attachments from a post
- pagination in a custom list created with get_pages function
- is pre_get_comments not working?
- How to replace default comments with custom HTML?
- Custom avatars in wordpress comments?
- how to load the comment template from a plugin
- Pagination not working with custom wp_query
- How does “Your comment is awaiting moderation” work?
- how to get the top 10 popular blogs
- disable defaault wordpress comments from a plugin
- How to show comments from different Plugins to same post type?
- How to check if `comment_meta` exists before inserting the comment?
- How to get the `comment_post_ID`?
- Email content as comment
- How to implement pagination into a wpdb->result query?
- Change Page title when Pagingation the posts
- Stop theme displaying comments
- Get Commentor IP When Marking Comment As Spam
- post_results filter confused by pagination in sidebar and main section
- isset($_POST[‘submit’]) ignored on comment submission
- Is it ever okay to include inline CSS in plugins?
- When would I use either function for plugins?
- Test to see if jQuery or Prototype is queued by another plugin?
- Is there a hook for when you switch themes?
- Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead
- How to add a new plugin page under desired Options page?
- Plugin screenshots not showing in the repository
- Multiple Parameters for a Shortcode
- How to properly load text domain of custom mu plugin
- Post from front-end with post types, categories and taxonomies
- product-attribute-slug-is-too-long-28-characters-max
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- Check if I am in the Admin Panel (wp-admin)?
- Fully automated theme install and activation via a plugin
- Using Ajax call in jQuery doesn’t work in widget
- Confusion on WP Nonce usage in my Plugin
- Add media and attach images to pages
- Why cant the WP Filesystem API read googlefonts.json?
- How to redirect to action on custom page within admin section
- How to determine if the current file is loaded in a plugin or in a theme?
- Hook to See if Comment got a Reply?
- How to convert this cURL to wp_remote_get?
- Which action is triggered when a theme was modified?
- Check if someone is editing a post (this content is currently locked)
- How insert negative values in Gutenberg box-control
- WordPress setting with select – where is my mistake?
- What filter should I use to insert a button inside on Media>Add New
- is user logged in not working
- Override class inside $atts shortcode_atts in WordPress
- Creating a shortcode, but getting tied up with OOP and Classes?
- External Authentication, session_tokens not destroyed on logout
- Adding custom fields to WordPress nav menus
- In woocommerce cart item we can add custom text but how can i add custom link? [closed]
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- How to Upload Images From a Folder (Not WP_Uploads)
- How to give a download link to a .csv file from the custom plugin?
- What’s wrong with this post__not_in argument?
- WordPress plugin enqueue scripts working for js, but not css files
- First and last name fields not filled when using wp_insert_user
- I am unable to save my data from a form
- my basic php code producing unexpected results
- Check if post belongs to any category
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Best practice for Designing a Plugin with this scenario
- Can calling wp_enqueue_style in wp_iframe apply the stylesheet to everything not just the iframe?
- wp_ prefix changed. What is the way to change so any prefix is understood?
- How to create wordpress media library UI on plugin page
- Why my theme’s css not working on another site
- How to create dynamic content with get_post_meta?
- Override category archive page title (not the head title)
- get_queried_object_id combined with wp_redirect gets wrong id
- Using WordPress Boilerplate (WPBP) for WP Multisite Plugin
- Return raw image proxy for wordpress plugin
- How to handle ajax Request in a complex-structured plugin?
- How to use functions from Woocommerce documentation?
- How to pass a more variable with page/subpage in Wordprees URL?
- Use a page as a template for a custom post type
- Dynamic sidebar areas not working on the Theme Customizer
- Merge Codes using redux framework
- Getting Plugin to read all script files
- How to use get_pages( ) correctly with ‘child_of’ to replace page with child page
- Problem with Poedit [closed]
- How to boost WP custom post REST API GET queries by custom taxonomies
- I want to redirect user to an amazon product page from my wordpress website when they add product to there cart [closed]