Limit RSS feed to previous calendar month
This approach doesn’t work for January: $lastMonthNumber = date( ‘n’, current_time( ‘timestamp’ ) ) – 1; as it would give 1 – 1 = 0. Here’s another suggestion, using the string to time support of the date query: $query->set( ‘date_query’, [ [ ‘after’ => ‘midnight first day of last month’, ‘inclusive’ => true, ], [ … Read more