Categories
WordPress WordPress Development

WP_Query Get Posts Published in the last 24 hours

$args = array(
 'post_type' => 'post',
 'posts_per_page' => '10',
 'date_query' => array(
 array(
 'after' => '24 hours ago'
 )
 )
 );
$the_posts = new WP_Query( $args );