Get all posts which was posted on X Days WordPress
You can try following code $y = date(‘Y’); $m = date(‘m’); $d = date(‘d’,strtotime(“-7 days”)); //Date you want $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘post’, ‘date_query’ => array( array( ‘year’ => $y, ‘month’ => $m, ‘day’ => $d, ), ), ); $posts= new WP_Query( $args ); //you will get posts which are posted … Read more