Skip to content

Instantly share code, notes, and snippets.

@cccamuseme
Created November 21, 2016 20:23
Show Gist options
  • Save cccamuseme/d662f15143e8764951c6059ae3755aba to your computer and use it in GitHub Desktop.
Save cccamuseme/d662f15143e8764951c6059ae3755aba to your computer and use it in GitHub Desktop.
echo post comments
<ol class="commentlist">
<?php
//Gather comments for a specific page/post
$comments = get_comments(array(
'post_id' => XXX,
'status' => 'approve' //Change this to the type of comments to be displayed
));
//Display the list of comments
wp_list_comments(array(
'per_page' => 10, //Allow comment pagination
'reverse_top_level' => false //Show the oldest comments at the top of the list
), $comments);
?>
</ol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment