Question: Following is my code which I am using to display comments of posts in a loop (Custom Post Types). I would like to display only latest 3 comments. Kindly help me to limit comments.

```
<?php  foreach (get_comments() as $comment): ?>
    <div><span class="author-name"><?php echo $comment->comment_author; ?> said:</span> <span class="author-cmnt">"<?php echo $comment->comment_content; ?>".</span></div>
<?php endforeach; ?>

```

Answer: 
I don't usually work with comment so my suggestion is untested, but I see that get\_comments() receives an array of args.

Try this:

`$comments = get_comments(array("number" => 3))`

and instead of your foreach loop:

`foreach ($comments as $comment):`
My answer to this is to use something like this:

```
$args = ['number' => 3];
$comments = get_comments( $args );

```