Hi, is this code correct to retrieve current day popular posts?
$today = getdate();
$args = [
‘post_type’ => ‘post’, // Assuming you want blog posts. Change if needed.
‘posts_per_page’ => 3, // Adjust to the number of posts you want.
‘order’ => ‘DESC’, // Order from highest to lowest views.
‘post__not_in’ => [ $post->ID ],
‘date_query’ => [
[
‘year’ => $today[‘year’],
‘month’ => $today[‘mon’],
‘day’ => $today[‘mday’],
],
],
‘orderby’ => ‘post_views’,
‘views_query’ => [
‘year’ => $today[‘year’],
‘month’ => $today[‘mon’],
‘day’ => $today[‘mday’],
],
];