WP_Query, orderby comment_count

Question

I use WP_Query to get posts by comment count

 $aArgs = [
        'posts_per_page' => 20,
        'post_status'    => 'publish',
        'post_type'      => ['post'],
        'paged'   => 1,
        'orderby' => 'comment_count'
    ];
    $oQuery = new WP_Query($aArgs);

All posts that have comment count greater than 0 are ordered correctly.
But in some posts(have 0 comment) display in at least 2 pages(Ex:paged=1 and paged=3).
I dont know why.
Please tell me how to fix this problem?

0
wiloke 4 months 2020-12-24T21:10:21-05:00 0 Answers 5 views 0

Leave an answer

Browse
Browse