Viewing 15 replies - 1 through 15 (of 18 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    I see 141 comments on that page. Is that how many you see? Which ones are in moderation?

    Thread Starter TH

    (@th)

    Now I have added another comment which is currently held in moderation. It still says 141 comments but there is an additional comment with the text content “This comment is in moderation”.

    I can see this even if I am logged out. And so apparently can other people.

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    Disable your plugins, see if one of them is causing it.

    Thread Starter TH

    (@th)

    I’ve done that, I’m afraid. No use.

    It’s been like this for a long time. I had sort of forgotten about the problem until a recent onslaught of spam made me aware of it again.

    Now I have a new clean WP install and everything new except for the theme. And still it persists.

    “This comment is in moderation”.

    That text is seen ONLY by the comment author and nobody else.

    Thread Starter TH

    (@th)

    Really? You can’t see it? Hmmm. But what about the spam comments that come in all the time that is held in moderation queue (by Akismet). They are visible to me when I’m logged out and I certainly didn’t post any of those.

    I only posted this example comment to show what I mean, but I guess I should have left some spam comments as well to illustrate.

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    moshu: No, he has a legitimate problem. That is the content of his comment, it’s what he typed. It’s not the “awaiting moderation” message there.

    TH: The thing is that the comments_template() function pulls out the comments and then your theme displays them. The comments_template() function won’t pull comments still in moderation unless it determines that the viewer of them is the author of the comment.

    However, your theme may be doing something different and pulling the comments out manually, in which case that code won’t work. Look through your theme and see if it’s doing any manual SELECT statements to get the comments or some such thing.

    Just to clarify: do you see the comments themselves that are in moderation… or they just appear in the count of comments?

    So, what is the test comment’s content? The one held in moderation. Just to make sure whether we see it or not.

    Thread Starter TH

    (@th)

    moshu: I typed the sentence “This comment is in moderation” into the text field of the comment form. I thought I was being smart but I guess I only confused everyone. Sorry. šŸ™‚

    That is the content of the comment. Where it says “This comment is in moderation” it could have said… whatever the commenter or spammer wanted to say.

    Otto42: I’m looking through my theme now for any smoking code guns…

    Thread Starter TH

    (@th)

    Could this be it? (It’s very difficult for my tiny brain to read code). If so, what can I change about it?

    <?php $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID ORDER BY comment_date DESC"); ?>

    <?php if ( $comments ) : ?>

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    Yep, there’s your problem. Broken theme.

    Post a copy of your theme’s comments.php file and single.php file (or index.php if there is no single.php file) over on http://wordpress.pastebin.ca so I can have a look at them and tell you how to alter them.

    Basically, the theme needs that code removed and some other changes to let it use the comments_template() function correctly.

    Aha, I see now… it’s the abnormal order of comments that confused me first: I was looking at the bottom for the latest. Then the text which was very similar to what WP displays if moderation is turned on (“Your comment is awaiting moderation.”)
    Sorry for the confusion.

    Thread Starter TH

    (@th)

    Wow! I didn’t know about the pastebin. That is quite cool!

    I’ve posted my comments file here:
    http://wordpress.pastebin.ca/921117

    And my index here:
    http://wordpress.pastebin.ca/921121

    Thanks a lot for your help so far guys! I’m sure looking at my code will be as painful as squeezing an unusually large lemon directly into the eyes. I apologize for my noobiness.

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    Wait a minute. Your index does not contain a call to the comments.php file. Do you have a single.php? If so, we need that instead.

    Basically, we need the file used when your comments are displayed. Whatever file in your theme calls the comments.php file, or makes a call to comments_template().

Viewing 15 replies - 1 through 15 (of 18 total)

The topic ‘Comments in moderation showing’ is closed to new replies.