Popular Post By Month in WordPress

I have been trying to get popular posts for the current month. I wrote the code given here. But showing nothing.

3,
‘post_type’ => ‘post’,
‘date_query’ => array(
array(
‘year’ => date( ‘Y’ ),
‘month’ => date( ‘m’ ),
),
),
‘meta_key’ => ‘wpb_post_views_count’,
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’,
);

$the_query = new WP_Query( $query_args );
?>
have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();

?>

” title=””>

” title=””>

Read more here:: Popular Post By Month in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *