wp-ulike
wp-ulike copied to clipboard
List the most like comments in the article.
$comment_query = new WP_Comment_Query( array(
'post_id' => get_the_ID(),
'meta_key' => '_commentliked',
'meta_query' => array(
array(
'key' => '_commentliked',
'value' => '0',
'compare' => '>'
)
),
'orderby' => 'meta_value_num',
'number' => 3
) );
wp_list_comments('type=comment&callback=zan_comment&end-callback=zan_end_comment',$comment_query->comments);
wp_list_comments('type=comment&callback=cm_comment&end-callback=cm_end_comment&max_depth=23');
Hello there. I use the code above to list the most like comments. There is also a wp_list_comments listed below for all comments. At this time, there was a problem with the paging. The page shows the comment on the first page, which is actually not the case.
Is there any solution? Or a better way to achieve this.