G
G
Genri_Rus2020-06-30 23:26:01
WordPress
Genri_Rus, 2020-06-30 23:26:01

How to display child comments?

Displaying comments using the get_comments() function

$args = array(
  'number'      => 5,
  'orderby' 	   => 'comment_date',
  'order'   	   => 'ASC',
  'status'  	   => 'approve',
  'post_id' 	   => $page->ID,
  'hierarchical' => 'threaded'
);

$comments = get_comments( $args );

foreach ( $comments as $comment ) {

}

Getting child comments:
5efb9fabd21c9657419852.png

But how do I get them?
There is a $comment variable, but I can't access it in any way

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question