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.

Live site

I'm using <?php comments_number( $zero, $one, $more ); ?> on home.php to display number of comments in the post-meta. Problem is, it's not showing the number despite there being one comment on that post. Any ideas what's causing the problem?

Here's post-meta for index.php:

<div class="post-meta">
                <p><?php the_date(); ?> | <?php the_tags('tags:', ', ', '<br />'); ?> | <?php comments_number( $zero, $one, $more ); ?> comments</p>
                <?php comments_template(); ?>
            </div><!-- end post-meta -->
share|improve this question

2 Answers 2

you need to replace $zero, $one, and $more with your own code; read the example in the Codex: http://codex.wordpress.org/Function_Reference/comments_number#Examples

share|improve this answer

You need to change the code you're using from

<div class="post-meta">
    <p><?php the_date(); ?> | <?php the_tags('tags:', ', ', '<br />'); ?> | <?php comments_number( $zero, $one, $more ); ?> comments</p>
    <?php comments_template(); ?>
</div><!-- end post-meta -->

to

<div class="post-meta">
    <p><?php the_date(); ?> | <?php the_tags('tags:', ', ', '<br />'); ?> | <?php comments_number( 'no responses', 'one response', '% responses' ); ?> comments</p>
    <?php comments_template(); ?>
</div><!-- end post-meta -->
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.