I need to display most commented posts and articles for the past week.
The code I came up with is following:

       $cat_black_args = array(
            'posts_per_page'    => '4',
            'orderby'           => 'date comment_count',
            'order'             => 'DESC',
            'category_name'     => $current_cat,
            'date_query'        => array(
                    'before' => array(
                        'year'  => date( "Y" ),
                        'month' => date( "m", strtotime( "-1 months" ) ),
                        'day'   => date( "d", strtotime( "-2 week" ) ),

It does work without data_query but most commented posts is display over all times with or without data_query.

Read more here: How to display most commented posts for the past week


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: