wp-ulike icon indicating copy to clipboard operation
wp-ulike copied to clipboard

List the most like comments in the article.

Open fantastlcok opened this issue 5 years ago • 0 comments

$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.

fantastlcok avatar Oct 31 '18 23:10 fantastlcok