How about direct sql with a simple subquery to first get all the post ids of your custom post type ex:
function get_all_comments_of_post_type($post_type){
global $wpdb;
$cc = $wpdb->get_var("SELECT COUNT(comment_ID)
FROM $wpdb->comments
WHERE comment_post_ID in (
SELECT ID
FROM $wpdb->posts
WHERE post_type="$post_type"
AND post_status="publish")
AND comment_approved = '1'
");
return $cc;
}
Usage:
$total_comments = get_all_comments_of_post_type('some_post_type');
Related Posts:
- Why are the comments disabled by default on my custom_post_types?
- Why are comments and trackbacks still getting through for custom post types?
- Taxonomy count per Post type
- Display Authors Comments on Profile Page
- List all posts commented by current user
- Count posts or custom post types from last 24 hours (or from today)
- Custom Comment Types
- Count posts that have specific taxonomy term attached
- Count post that have specific meta value
- modify all posts of a category to “no comments allowed”
- Custom comment status possible?
- feed links for custom post type pages
- Seperating custom post type comments from regular blog posts comments
- Add comments meta fields to comments metabox on post edit screen
- Exclude post_type from admin comments_list
- taxonomy list display custom post count
- Count custom post types with a specific meta value
- Custom Post Type Category List & Post Count
- Recent comments on author page?
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- Comment moderation on custom post types
- Taxonomy list. Order by a specific custom post type count
- Get count of custom post type created by current user
- Automatically check “Allow comments” for custom post type [duplicate]
- How could I create a ‘private comments’ section on a custom post type?
- Disable comments from showing up public for Custom Post Type
- Custom Post Type loops and Disqus
- get_queried_object error How to show post count by month in the taxonomy page
- “Allow Comments” box cannot be checked
- How to count custom post types with conditional operators
- Separate comment section for post type in dashboard
- Count posts with specific term_meta
- count_many_users_posts except current logged in user?
- right_now_content_table_end function not working?
- WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin
- custom comments on specific post type
- Insert data on comment post
- Query/list all terms and their custom post count
- How to make sure content doesn’t display if selection is empty
- get_comments not working on custom post types
- Custom Post Type Set Comments ON by default without show METABOX
- WordPress comments_open for specific user role or post type
- Post count by month of taxonmy term
- custom post type category count shortcode
- Add custom field in comments form
- Create another comment system for CPT
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Convert comments to Custom Post Type
- How to assign classes to all elements?
- custom comments form for custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- How to display author post count for multiple custom post types?
- comment_notification_text filter for custom post type
- get comments by current user inside page template
- Post loop count is not in order
- User-submitted reviews of different custom post types
- Check if user has comment on current post
- I am trying to get cutom post cout by month of current taxonmy term
- Enable comments on custom page type – option not showing in “customize” for theme
- Allow anonymous comments just in a custom post type
- how to count the current posts terms
- duplicate comment section functionality and call it something else for custom post types
- Trying to add a class to post links
- How to count other posts not having specific taxonomy terms?
- WordPress Count posts within a custom post type
- Send email messages after comment was submitted
- comments hooks on custom post type
- custom comment fields on CPT
- unapprove comments on custom post type
- Enable comments for post when comments meta box removed
- Display custom post counts for author , not default posts
- Get the latest comment from a custom post type where depth = 1?
- Why will comments not remain open on custom post types?
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- How to change the comments form title based on post type
- display post count in archive page that have relation with another taxonomy term
- Comments on posts with new custom post type redirected to another post
- Display category filters for custom post type when category is shared by multiple post types
- How do I find the count of the current post?
- Display custom posts, ordered by most commented, without duplicates
- get_queried_object not work in taxonomy page
- Get queried object for custom post type count
- How to show custom post count in archive page
- I have a problem with displaying children pages of custom post type
- Modify the category post counting function
- get comments for custom post type
- Counting custom post type with wp_count_posts returns an empty object
- Turn off comments for given CPT checkbox?
- Author profile comments system
- Custom post type: can’t enable comments by default
- How to add a post counter to the list of custom taxonomy terms?
- Comment moderation with disqus comments
- add comments custom fields after user is logged in
- how to show Author post type count
- Comments are not working on Custom Post Type
- Error 403 when posting comments to a custom post type from a different page
- Comments not working (error not allowed) on posts with custom post status
- Complex Custom Loop with Includes
- Hide load more button if no more post in selected category