Display popularpost posts of the last 2 days
in argument list please also pass date_query, try below example. $args = array( ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘order’ => ‘DESC’, ‘date_query’ => array( ‘after’ => ‘2 days ago’, ‘inclusive’ => true ) ); $posts = get_posts($args);