Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

everybody! I stumbled across strange problem when creating a theme for WordPress. I have written a simple function in my comments.php. Here is a snippet of the beginning:

<?php if ( have_comments() ) :

    if ( ! empty($comments_by_type['comment']) ) : 

    print_r(comments_number()); ?> 

          <h3 id="comments"><?php comments_number(__('0 Replies', 'chita'), __('1 Reply', 'chita'), __('% Replies', 'zilla')); ?></h3>

       <ol class="commentlist">
           <?php wp_list_comments('type=comment&callback=my_comments'); ?>

And after importing the Theme Unit Test XML file and opening the post that is full of comments, it's displaying them, but the heading is "No Replies". However after I manually post a new comment, it refreshes and shows the number of comments as it should be.

print_r(comments_number()); outputs No Comments. Where does this problem comes from? Is t a bug or there is something that I'm missing?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.