Last active
July 31, 2016 05:28
-
-
Save jimmitchell/456c5d123354dfbdc305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
// Exclude pingbacks from comment count | |
// change "slug" to your theme's domain | |
function slug_comment_count( $count ) { | |
global $id; | |
$comment_count = 0; | |
$comments = get_approved_comments( $id ); | |
foreach ( $comments as $comment ) { | |
if ( $comment->comment_type === '' ) { | |
$comment_count++; | |
} | |
} | |
return $comment_count; | |
} | |
add_filter( 'get_comments_number', 'slug_comment_count', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment