Created
October 27, 2013 02:44
-
-
Save Shelob9/7177412 to your computer and use it in GitHub Desktop.
Most commented WordPress posts in the last week. 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 | |
$args = array( | |
'date_query' => array( | |
//set date ranges with strings! | |
'after' => '1 week ago', | |
'before' => 'today', | |
//allow exact matches to be returned | |
'inclusive' => true, | |
), | |
'orderby' => 'comment_count', | |
'order' => 'DESC', | |
'posts_per_page' => '5', | |
'paged' => '1', | |
); | |
$query = new WP_Query($args); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment