Skip to content

Instantly share code, notes, and snippets.

@davechu
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save davechu/e1d1fcd06591c7f2d143 to your computer and use it in GitHub Desktop.

Select an option

Save davechu/e1d1fcd06591c7f2d143 to your computer and use it in GitHub Desktop.
// dave add published comments.
add_action('sensei_single_main_content', 'dc_add_comments_to_template');
function dc_add_comments_to_template() {
//Gather comments on the post
$comments = get_comments(array(
'post_id' => get_the_ID(),
'status' => 'approve' //Change this to the type of comments to be displayed
));
//Display the list of comments
echo '<div class="entry-comments"><ul>';
wp_list_comments(array(
'per_page' => 10, // Allow comment pagination (optional)
'type' => 'comment', // Very important! Otherwise you get Woo's comments for some internal process.
'reverse_top_level' => false // Show the latest comments at the top of the list
), $comments);
echo '</ul></div>';
}
// end of dave's code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment