Last active
August 29, 2015 14:08
-
-
Save joeyz/f52c797ceffdf938fce1 to your computer and use it in GitHub Desktop.
Hide passed custom posts by datepicker value
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
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'events', | |
'pagination' => true, | |
'paged' => $paged, | |
'meta_query' => array( | |
array( | |
'key' => 'event_date', | |
'value' => date('Ymd', strtotime('now')), | |
'type' => 'numeric', | |
'compare' => '>=', | |
) | |
), | |
'meta_key' => 'event_date', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC' | |
); | |
// The Query | |
$query_events = new WP_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment