G
G
Genri_Rus2020-07-01 20:54:16
WordPress
Genri_Rus, 2020-07-01 20:54:16

Is it possible to implement ajax pagination of comments using the get_comments function?

Here is an example:

$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 ) {
  
}

I have 5 comments displayed on the Reviews page, but if more than 5, then the button appears: "To previous entries"
Is it possible somehow to load new comments by clicking on this button?

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