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:

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?

3 Answers
3

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.

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:

I see what you mean there. Another possibility is either the file is corrupted or the permission is wrong. Unless he has something else on other files controlling comment that he's not aware of.
–
Sean LeeJul 17 '11 at 23:25

My best guess at this point is that it's one of the two Plugins he referenced.
–
Chip BennettJul 18 '11 at 0:05

you're probably right, and most likely the gyc_blog_comments function. perhaps function_exists did not recognize it, and stop to interpret the rest.
–
Sean LeeJul 19 '11 at 21:09