Display posts of the last 7 days
In addition to birgire’s solution, as of WordPress 3.7, you can use Date parameters. Your arguments would look like this to filter posts from the last 7 days: $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, // Using the date_query to filter posts from last week ‘date_query’ => … Read more