Created
October 27, 2013 02:42
-
-
Save Shelob9/7177402 to your computer and use it in GitHub Desktop.
Show WordPress posts published on this day last year. See: http://JoshPress.net/blog/using-new-date-queries-wordpress-3-7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$today = getdate(); | |
$args = array( | |
'date_query' => array( | |
array( | |
//simply subtract one year from current year | |
'year' => $today["year"]-1, | |
'month' => $today["mon"], | |
'day' => $today["mday"], | |
), | |
), | |
); | |
$query = new WP_Query( $args ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment