I want to get the 5 most recent comments and each comment's 5 most recent replies (children) in descending order. With the following code I can get the 5 most recents comments but it won't distinguish comments from replies which results in a list of comments independently of their 'type' (comment or reply). How can I do this?
<?php
$comments = get_comments(array(
'post_id' => $id,
'status' => 'approve',
'number' => '5' //Number of comments
));
if ( have_comments() ) : ?>
<?php $args = array(
'walker' => null,
'max_depth' => '2',
'style' => 'div',
'callback' => customComment, // templates/comment-template.php
'end-callback' => null,
'type' => 'all',
'reply_text' => 'Reply',
'page' => '',
'per_page' => '',
'avatar_size' => 32,
'reverse_top_level' => false,
'reverse_children' => false,
'format' => 'html5', // or 'xhtml' if no 'HTML5' theme support
'short_ping' => false, // @since 3.6
'echo' => true // boolean, default is true
); ?>
<?php wp_list_comments( $args ); ?>