Support » Themes and Templates » Easy one for the pros (2.7.1)

  • Have an easy one (hopefully).

    When a non-logged-in visitor leaves a comment and comment moderation is enabled, they are shown a “Your comment is awaiting moderation…” preview box of their comment.

    The theme check for this is $comment->comment_approved returning true.

    Well all of a sudden my visitors (checked it myself) are not shown this message, however I still see $comment->comment_approved is set properly in the loop.

    Seems like the comments loop just suddenly stopped looking for posts that were not yet approved.

    Any troubleshooting ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Instead of checking for a return of true, do this:

    <?php if ($comment->comment_approved == '0') : ?>
    <p class="alert"><?php _e('Your comment is awaiting moderation.') ?></p>
    <?php endif; ?>

    Hey Nathan, it’s already set up that way… 0 = FALSE, 1 = TRUE.

    Could it be a cookie issue?

    As I said, it seems like the pending comment isn’t even hitting the comments loop. I’d really appreciate any input from a Dev or whatnot on what I should be looking for.

    Been a few days, was hoping someone would come to my rescue. 🙂

    I’ve tried everything except for reinstalling WordPress, including reverting to the default 2.7.1 theme.

    Again, my $comment_approved check looks like this, yet the user is not shown their post-preview, almost as if the yet-to-be-approved comment isn’t hitting the comments loop:

    if($comment->comment_approved == '0') :

    Any devs that could shoot me something to check out (is it a cookie thing?), would be much appreciated.

    Read: my test comments have been going to the akismet spam queue. Unfreakinbelieveable.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Easy one for the pros (2.7.1)’ is closed to new replies.