<?php $comments = get_comments('status=approve&number=5'); ?>
<ul class="widgcomm">
<?php foreach ($comments as $comment) { ?>
<li class="comcont"><?php
$title = get_the_title($comment->comment_post_ID);
echo get_avatar( $comment, $size = '35');
echo '<span class="tecom">' . ($comment->comment_author) . '';
?> к посту: </span><a class="auth" href="<?php echo get_permalink($comment->comment_post_ID); ?>"
rel="external nofollow" title="<?php echo $title; ?>">
<?php echo $title; ?> </a>
"<?php
echo '<span class="tecom">' . wp_html_excerpt( $comment->comment_content, 35 ) .
'</span>'; ?>.."
<?php $d = "M d, Y";
$comment_ID = $comment->comment_ID;
$comment_date = get_comment_date( $d, $comment_ID );
$comment_PID = $comment->comment_post_ID;
echo $comment_date;?>
<?php echo 'Всего комм.: '.get_comments_number($comment_PID) ?>
</li>
<?php } ?> </ul>
$comments = get_comments([
'status' => 'approve',
'number' => 5,
'date_query' => [
'before' => 'now',
'inclusive' => false,
],
]);