WordPress comment count to include attachment comments

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.