Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List the most like comments in the article. #37

Open
fantastlcok opened this issue Oct 31, 2018 · 0 comments
Open

List the most like comments in the article. #37

fantastlcok opened this issue Oct 31, 2018 · 0 comments

Comments

@fantastlcok
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant