R
R
Roman Zharov2015-11-28 11:31:32
Web development
Roman Zharov, 2015-11-28 11:31:32

Make comments load on click on wordpress button?

Greetings!
Unable to load comments on button click.
That is, you need to display 5 comments, and the download button, by clicking on which we display 5 more, etc.
I receive comments like this: (this is already when we clicked to load more comments)

<?php
$args_list = array(
    'callback' => 'mytheme_comment',
  );
  $args = array(
    'order' => 'ASC',
    'offset' => $offset,
    'number' => $items,
    'post_id' => $post_id,
  );
  $comments = get_comments($args);
  wp_list_comments($args_list, $comments);
?>

Accordingly, the required values ​​are passed to the offset and number post_id parameters.
But when using the number parameter, the tree view (nesting) of comments is violated.

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