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?