?> </p> <?php do_action('franz_protected_comment'); ?> </div> <?php return; } do_action('franz_before_comment_template'); /* Lists all the comments for the current post */ if (have_comments()) { /* Get the comments and pings count */ $comments_num = franz_get_comment_count(); $allcomments_num = franz_get_comment_count('comments', false); $pings_num = franz_get_comment_count('pings'); if ($comments_num) { $comment_count = sprintf(_n('%s comment', '%s comments', $comments_num, 'franz-josef'), number_format_i18n($comments_num)); } if ($pings_num) { $ping_count = sprintf(_n('%s ping', '%s pings', $pings_num, 'franz-josef'), number_format_i18n($pings_num)); } $is_paginated = get_option('page_comments'); $comments_per_page = get_option('comments_per_page'); ?> <div id="comments"> <div class="row"> <h3 class="comments-heading col-sm-8"><?php echo $comment_count; ?> </h3>
/** * Adds the functionality to count comments by type, eg. comments, pingbacks, tracbacks. * Based on the code at WPCanyon (http://wpcanyon.com/tipsandtricks/get-separate-count-for-comments-trackbacks-and-pingbacks-in-wordpress/) * */ function franz_comment_count($type = 'comments', $oneText = '', $moreText = '') { $result = franz_get_comment_count($type); if ($result == 1) { return str_replace('%', $result, $oneText); } elseif ($result > 1) { return str_replace('%', $result, $moreText); } else { return false; } }