For some strange reason, comments aren’t being displayed when a user is not logged in. I’ve done some extensive experimenting with comments.php without any success. Here’s a reference to the example page:
http://gycweb.org/by-this-will-all-men-know/
If you are logged in, you would see 3 comments. If you are not logged in, nothing but the form. Also, to add to the mystery, when “editing” the post from within the admin and clicking “show comments”, it tries and is not able to load the comments.
It appears that the “have_comments” conditional is failing for logged out users. I’ve also tried getting wp_list_comments to return the list with no success.
I’ve checked for plugin conflicts and nothing obvious yet. Have any of you run into this? Any obvious answers?
Probably your web-server user does not have permissions to create new files. I believe that WordPress caches comments on pages and posts for not logged users, so that only authenticated users get fresh comments list. When logged out user inputs a comment, the list gets updated with his comment too, which brings them the whole list (I tried that on my WP instance and yours, it works that way). Otherwise WP tries to get comments from a file, that it couldn’t create beforehand, resulting in have_comments() returning false.
So, if you provide write permissions for www-data or whatever else is called your web-server user, you will forget for the problem.
The whole thing is still a theory, as I won’t have access to my installation for about 10 days, but I strongly believe that this is the solution.
Toscho was right. I wound up having a query that was getting in the way. It took a bit of troubleshooting to figure out, but I nailed it.
If you run into similar issues, look carefully for any custom queries you may have on the template and make sure that you’ve wrapped them up properly.
According to your original question, “If you are logged in, you would see 3 comments. If you are not logged in, nothing but the form…. It appears that the “have_comments” conditional is failing for logged out users.”
Is your intention to show comments for all users, both logged in and out?
If you want comments to show for logged out users, then you need to remove this: