Created
September 1, 2016 16:16
-
-
Save hasanm95/4c267c29237ab3a6d602e66c45c8f610 to your computer and use it in GitHub Desktop.
Wordpress comments list for homepage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol class="commentlist"> | |
<?php | |
//Gather comments for a specific page/post | |
$comments = get_comments(array( | |
'status' => 'approve' //Change this to the type of comments to be displayed | |
)); | |
$args = array( | |
'walker' => null, | |
'max_depth' => '', | |
'style' => 'div', | |
'callback' => null, | |
'end-callback' => '', | |
'type' => 'all', | |
'reply_text' => '', | |
'page' => '', | |
'per_page' => '', | |
'avatar_size' => '', | |
'reverse_top_level' => null, | |
'reverse_children' => '', | |
'format' => 'html5', | |
); | |
//Display the list of comments | |
wp_list_comments($args, $comments); | |
?> | |
</ol> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment