gpt4 book ai didi

提交评论时 WordPress 'comment is awaiting moderation.' 消息未出现?

转载 作者:行者123 更新时间:2023-12-03 06:49:18 31 4
gpt4 key购买 nike

一切都与 WP 示例相当标准,仅进行了少量修改。但提交评论时,不会显示“您的评论正在等待审核”消息。

comments.php:

    <div id="comment-block"> 
<h4><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h4>
<ul id="commentlist">
<?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
</ul>
<?php // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>
<h4>Leave a reply</h4>

<div class="cancel-comment-reply">
<small><?php cancel_comment_reply_link(); ?></small>
</div>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p class="loggedIn">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>

<?php else : ?>
<table width="675" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding-right: 20px;"><label for="author">Name <?php if ($req) echo "(required)"; ?></label></td>
<td style="padding-right: 20px;"><label for="email">Email <?php if ($req) echo "(required)"; ?></label> <small>(will not be published)</small></td>
<td><label for="url">Website <?php if ($req) echo "(required)"; ?></label></td>
</tr>
<tr><td style="padding-right: 20px;"><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" class="text" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /></td>
<td style="padding-right: 20px;"><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" class="text" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /></td>
<td><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" class="text" tabindex="3" /></td>
</tr>
</table>
<?php endif; ?>
<label for="comment">Comment <?php if ($req) echo "(required)"; ?></label><br />
<textarea name="comment" id="comment" rows="10" tabindex="4" class="text"></textarea>
<input name="submit" type="image" src="<?php bloginfo('template_directory'); ?>/images/submit_button.png" width="130" height="24" alt="Submit" id="submit" tabindex="5" />

<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<div class="clear"></div>
<?php endif; // If registration required and not logged in ?>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>

以及functions.php中的mytheme_comments函数

 function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<span class="comment-author vcard">
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says at</span>'), get_comment_author_link()) ?>
</span>

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


<span class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
<?php printf(__('%2$s, %1$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></span>

<?php comment_text() ?>

<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
}
?>

最佳答案

我的英语很差!

我已经找到解决方案了,你可以尝试一下!

此问题通常与托管网站的实际域有关

例如。

<1>如果您的网站托管在“anotherdomainsite.com”上

并且您的域名是“yoursite.com”那么就会出现这个问题!

您可以尝试更改您的实际域名!它实际上托管着您的网站!意味着托管和域名应该相同!

<2>你可以尝试的事情在您的网站上提交评论当你完成时

替换实际托管域而不是指向的域

例如。

http://yoursite.com/yourposturl/#comment-265

放置 anotherdomainsite.com 而不是 yoursite.com

关于提交评论时 WordPress 'comment is awaiting moderation.' 消息未出现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1730510/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com