A gallery is a post with attached media. So maybe you’ll find hints like this : just hook on get_comment_numbers() and pass $attachment_id.
I think in this case you’ll have to add an SQL query to get the comment count for attachment and then you’ll be able to add it to the total number of comments for post , something like this :
global $wpdb;
$wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE post_type="attachment"" ) ;
I haven’t tested yet. Hopefully this will help you.
Related Posts:
- show number of open comments on custom dashboard
- Comment Count for each Comment Author
- Count comment threads, not total comments in a post
- How can I count only guests comments?
- How many members have made comments approved for an article?
- Add an attachment feature to comments
- How to get comment images stored as serialized comment meta
- counting trackbacks, pingbacks and comments of a post
- How to Define Custom Number of Items in Comment Feed
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- How include comment and post count of user in this custom query
- how show attachment image in comments query
- comments reply script not working
- What should I do to make generated avatars different for anonymous comments?
- Check If comment author is registered
- How do I set up real anonymous posting in bbpress forums? [closed]
- How do I turn off wordpress comments ability to capture a users ip address?
- Success message in comment form
- How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?
- Is there a hook for comment author link?
- Exclude internal links from comment moderation?
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Change the HTML output of comments
- How to Block Access to Standard Login Flow and Comment Flow
- Upload images with comment
- Prevent Contributor to show comment list
- where to modify get_comment_author_link()?
- Change language of comments template
- Why Allow Script Commands in Comments?
- How to enable comments options?
- If new comment posted in custom post – send notification to custom email from custom field
- WP_Comment_Query with 5 top level comments per page?
- Can I have two single.php files and have one display just the post and the other display comments for that specific post?
- How can I change the link in comment form “Log in to post a comment”?
- WordPress admin bar showing pending comments which cannot be selected or modified after deleting parent page
- Get only one comment per post with get_comments
- What is the correct/safe way to delete all comments?
- Setting comment text as required
- Draft / schedule comments?
- How to insert Comment metadata via REST API
- How to remove these comments and html tags from the content?
- How to create a link to jump to “Leave a comment” part?
- Opening all posts for comments
- Unix timestamp for post comment
- In wp_list_comments(), what is a short_ping?
- Check if someone recently commented in one of my posts
- How to query comments only for the current post?
- Sync comment data
- WordPress Comments are automatically publishing
- Comment displaying full name even after setting another display name?
- How to move comments box above comments
- save_post action hook for comments
- Ability to leave comments broken
- How to disable comment flood temporarily in a single scope
- How to create a seperate commenting system?
- Change how many approved comments must user have
- Only admin can see comments on post or page
- Show comments of a user post only when they are login
- Display Custom comments field number
- How to get and use the the number of days since the last comment?
- Trying to post a wordpress comment on my site redirects to 127.0.0.1
- How do I add class to an admin comment?
- Best way to tell if a comment is from a user?
- Make user’s name display as the site name in comments if it matches certain roles
- Display avatar with comment form?
- Adding SQL source code to comments
- How to control size of comments popup window?
- How to make comments private for commentor and post author
- Name of comment field differs on different sites
- WordPress Spam Comment Filter
- Applying same style to all the comments on the page
- Customise Comment form
- assumed as comment line
- stumped on add_action hook to delete_comment – any ideas?
- Avoiding calls to theme-compat
- Allow tags between shortcode in comments
- How to load new posts from wordpress db into wordpress homepage without refreshing the site?
- Delete/Spam Comment Button
- Who approved a comment, to show up in dashboard
- comments.php remove date/time’s #hyperlink
- comment just attachment .. reply just text … can I do that?
- No comment Section but still got a Comment
- How to prevent users/authors from seing IP/email of new commentators?
- Why are my threaded comments not quite working? [closed]
- $post->comment_status always returns ‘closed’
- edit comments in front end
- How to replace anonymous comment form with a registration form on wordpress?
- How to get the 5 most recent comments and each comment 5 most recent replies (children)
- Redirect first time comments
- comment files and s
- Disqus moderation page not working in WordPress admin section
- How to hold all comments for moderation, including author’s comments on own post
- Comment forum to display under the comment you’re replying too
- Recent comments per tagged post?
- Subscribe to a post’s comments without posting a comment yourself
- How to hide the login / profile urls on top of comment box for a post
- Why default comment fields don’t show up?
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Customize the new comment notifications sent to the post author after the comment is approved
- Get approved comments or comments that the author is me