コード例 #1
0
ファイル: comments.php プロジェクト: samuel657677/flipbook
    ?>
</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>            
コード例 #2
0
ファイル: comments.php プロジェクト: ravitechrlabs/wordpress
 /**
  * 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;
     }
 }