WordPress.org

Ready to get started?Download WordPress

Forums

Response to user when comment submitted (5 posts)

  1. pcmt
    Member
    Posted 8 years ago #

    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.

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

  3. pcmt
    Member
    Posted 8 years ago #

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

  4. binarymoon
    Member
    Posted 8 years ago #

    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.

  5. pcmt
    Member
    Posted 8 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags