I think you are put the code in your single.php.
Then use loop for this, like
$post_obj = new WP_Query($args);
while($post_obj->have_posts() ) : $post_obj->the_post();
//display comments
$comments = get_comments(array(
'post_id' => $post->ID,
'number' => '2' ));
foreach($comments as $comment) {
//format comments
}
endwhile;
Also Check out this, in case you want comments from specific post.
http://codex.wordpress.org/Function_Reference/wp_list_comments#Display_Comments_for_a_Specific_Page.2FPost
(@jonpaulwade)
10 years, 10 months ago
For my mobile theme I wish to show only the last 3 comments for that post (or page) and the new comment form.
I added this code to the comments.php
However, this shows the last 3 comments for the whole site, not for that page. Better than showing all comments (some pages have hundreds) but not what I wanted to do.
Does anybody know how to get the current page comments to show?
Many thanks
Jon.