Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function post_comment_count() {
- function comment_count( $count ) {
- if ( ! is_admin() ) {
- global $post;
- $comments_by_type = &separate_comments(get_comments('status=approve&post_id='. $post->ID ));
- return count($comments_by_type['comment']);
- }
- else {
- return $count;
- }
- }
- add_filter('get_comments_number', 'comment_count', 0);
- $actual_comment_count = get_comments_number();
- return $actual_comment_count;
- }
- add_shortcode('post_comment_count', 'post_comment_count');
Advertisement
Add Comment
Please, Sign In to add comment