Some time back, we had seen how a Simple Fast Forward Button can show how much you respect your reader’s time. (get it here) Today, I just tweaked some code so as to say hello to first time commentators. No, this is not about those plugins that send an email when they comment, in fact this is not about any plugin.
Here is a screenshot of what the result will look like…
Usually, when a comment is held for moderation, you get the message ‘Your comment is awaiting moderation’. Well, this doesn’t help us much; some may not even understand what that mean. The idea is to edit that default message and display a friendly hello message as above.
Say Hello to First Time Commentators
The default text ‘Your comment is awaiting moderation’ is inside a file comment-template.php. We are going to edit this file, replace the text with our new message and tweak the position of the message so that it looks good. Follow the steps.
Find the file: the file comment-template.php is in the wp-includes folder of your WordPress installation.
Download it: Bring the file to your computer via your favorite FTP program.
Backup the file: Save a copy of the file securely. (Backups don’t mean that you are going to make errors, it’s just the part of a standard procedure.)
Find the text: Open comment-template.php in a text editor and search for ‘moderation’. You will end up with a line like this on line number 1229 if you haven’t edited the file before.
<em><?php _e('Your comment is awaiting moderation.') ?></em>
Write your message: Replace the text ‘Your comment is awaiting moderation’ with your own custom message. You can use the standard html here like line-breaks and italics. By default it takes the style from your style sheet. Make sure that the message is more general because at times comments from old commentators will also go into moderation. They might be annoyed to find you thanking them for their first comment.
Tweak the Code: If you save the file after the last step, the message will come after the name of the commentator as below.
So move the line you just edited to above the name of the commentator in the comment-template.php file . The final code will look like
comment_approved == ‘0’) : ?>