have_comments() returns false [with comments_template()]

My wordpress installation is behaving very strangely. First the recent posts stopped working, now this…

I’m working on my custom wordpress theme and I got stuck on the comments. Actually, I just copied the code for the comments template and the 3 functions from this tutorial.

Read More

I found a solution that says I should call the template with comments_template() instead of the general include method and that is how I do it. It still doesn’t show a single comment, even though get_comments_number() returns 2 and I see the comments in the dashboard.

Any ideas ?

Related posts

Leave a Reply

1 comment

  1. I did suck with this also 5 mins ago.

    Yes, you should call this comments_template() function.

    Call it like this:

    comments_template( '', true);
    

    and then make a comments.php in your theme directory, and do the

     if (have_comments()) {
        ...
    }
    

    cycle.

    It should work.