<?php
// Put the 'testimonials' id here
$comments = get_comments("post_id=$post_id&status=approve");
if ($comments) { $ndx = mt_rand(1,sizeof($comments)) - 1;
$comment = $comments[$ndx]; }?>
<H3> <a href="#"><?php the_title(); ?></a>
</H3>
<p>
<?php echo $comment->comment_content; ?>
</p>
<p>
<?php echo $comment->comment_author; ?>
</p>bu kodlarla bir tane rastgele yorum getirebiliyorum ama benim 10-15 tane getirmem lazım. aynı kodu da alt alta on kere yazmak istemiyorum acil yardımlarınızı bekliyorum
aşağıdaki kodları deneyin. kontrol etmedim, the_title hata verebilir, hata verirse echo $post_name kullanın.
<?php
$comments = get_comments(array('post_id' => '', 'status' => 'approve', 'number'=>'10'));
foreach($comments as $comment) :
}?>
<h3><a href="#"><?php the_title(); ?></a></h3>
<p>
<?php echo $comment->comment_content; ?>
</p>
<p>
<?php echo $comment->comment_author; ?>
</p>
<?php endforeach; ?>