开发者

How do I get rid of the "Your comment is awaiting moderation." message in Wordpress?

开发者 https://www.devze.com 2023-01-06 01:51 出处:网络
I coudn\'t find t开发者_开发知识库he php that generates that or do I have to deactivate it from the Site admin?You\'ll need to use your own callback for wp_list_comments() - check out Twenty Ten\'s co

I coudn't find t开发者_开发知识库he php that generates that or do I have to deactivate it from the Site admin?


You'll need to use your own callback for wp_list_comments() - check out Twenty Ten's comment callback twentyten_comment() as an example.

You'll see a line something along the lines of;

<?php if ( $comment->comment_approved == '0' ) : ?>
    <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
    <br />
<?php endif; ?>

You could pretty much copy and paste twentyten_comment() into your own theme, removing the block of code above, and then using wp_list_comments('callback=my_comment_callback') in comments.php.


Easiest way without cracking the code or bothering with a child theme is to hide it using css. In the theme I'm looking at now, that text is in a span tag assigned to the class "comment-await"

<span class="comment-await">Your comment is awaiting moderation.</span>

Most themes now offer a custom css option in the Customize section, so:

span.comment-await{display:none;}

You can play with changing the text by using css before or after selectors. Of course, you only want to do this for little changes, It it gets extensive the right way is to create a child theme and override the theme by editing comments.php (or other relevant file)


  1. Download and Install Notepad++.
  2. Open Notepad++
  3. Hit "Ctrl-F" to get a Find dialog.
  4. Change to the Find in Files tab ("Ctrl-Shift-F" might shortcut you here).
  5. Change the filter to *.php
  6. Change the location to your wordpress folder
  7. Ensure you have Search in Subdirectories enabled.
  8. Search for "Your comment is awaiting"
0

精彩评论

暂无评论...
验证码 换一张
取 消