我需要一个解决方案,将允许用户在评论页面内容的评级。
之后,当我需要在我的网站上的不同位置显示评论(带有评级星)时,问题就出现了,我会在旋转木马中显示所有评论。
目前,我有一个包含所有必要信息(评论作者姓名或评论内容)的旋转木马,我只缺少这个评级系统的实现:
<?php
$args_count = array(
\'count\' => true
);
$comments_query_count = new WP_Comment_Query;
$comments_count = $comments_query_count->query( $args_count );
$args = array(
);
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query( $args );
if ( $comments ) {
for ($i=0;$i<$comments_count; $i++) { ?>
<div>
<div class="a24-carousel-item">
<div class="row">
<?php echo get_avatar($comments[$i]->comment_author_email);?>
<div class="HERE I NEED stars from specific comment"></div>
<p class="author"><?php echo $comments[$i]->comment_author ?></p>
<p class="date">Added: <?php echo $comments[$i]->comment_date ?></p>
<p class="associated-post"><?php echo get_the_title($comments[$i]->comment_post_ID) ?></p>
<p class="content">
<?php echo $comments[$i]->comment_content; ?>
</p>
</div>
</div>
</div>
<?php
}
}
?>
有人知道如何帮助我在旋转木马中显示评论评分吗?