我在我的网站的主页和评论表格中有一个客户评论部分。我需要在那里显示我的客户意见,但不应该针对任何帖子。 我使用此代码来显示评论,但你知道它需要一个职位ID来获得评论。WordPress的 - 在主页上提交评论
<?php
$args = array(
'post_id' => 388
);
$comments = get_comments($args);
foreach($comments as $comment) :
?>
<div class="client-comment">
<span><a href="#"><?php comment_author(); ?></a></span>
<p><?php echo comment_text(); ?></p>
</div><!-- .client-comment -->
<?php endforeach; ?>
你是否查找过任何WordPress插件的评论? –
不,我不想为此使用任何插件。 –