Support » Everything else WordPress » Response to user when comment submitted

  • I would like to display a line like “Thankyou for your comment.” to replace the comment form (or above the form) when someone submits a comment.

    Could anyone please suggest a way to do this? The reason is that I don’t want to display the actual comments in all cases but would like the user to know their comment was successfully received.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Mark (podz)


    Support Maven

    Thanks. With a few alterations, that did the trick very nicely.

    I’ve just been looking for something just like this

    IMO a better way to do it (the solution I’m now using) is to to use this

    if ($comment->comment_approved == ‘0’) : ?>
    <p class=”alert”>Thanks for your comment. It is currently in the moderation cue and should be visible for everyone to read soon.
    <?php endif; ?>

    in the comment loop. This requires no hacks to your wordpress files so will continue to work when you upgrade.

    Point taken, but what I needed was something a little different. On the site in question the comment system is being used to obtain user feedback (in private) instead of publicly visible comments. So when the feedback is submitted a line appears saying “Thankyou etc” instead of the comment form. The comment form only reappears when the page is revisited (at which point the feedback line has disappeared).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Response to user when comment submitted’ is closed to new replies.