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 );

Leave a Reply

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

*