Created
September 16, 2018 11:09
-
-
Save mjinayan80/567e47ffe89b59a3872aa5dd8333a9ca to your computer and use it in GitHub Desktop.
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 | |
$sdtime = DateTime::createFromFormat("d F, Y", '1 February, 2018'); | |
$edtime = DateTime::createFromFormat("d F, Y", '30 February, 2018'); | |
$startday = $sdtime->getTimestamp(); | |
$endday = $edtime->getTimestamp(); | |
$q = new WP_Query( | |
array( | |
'posts_per_page' => $count, | |
'post_type' => 'fixture-item', | |
'meta_key' => 'date', | |
'orderby' => 'meta_value', | |
'order' => 'DESC', | |
'meta_query' => array( | |
array( | |
'key' => 'date', | |
'value' => array( $startday, $endday ), | |
'compare' => 'BETWEEN', | |
), | |
), | |
) | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment