Created
June 10, 2013 17:50
-
-
Save anonymous/5750810 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* I want to get this query to also desplay events that are on the current day. | |
* Any Ideas on how I can do that? | |
* I added '>=' instead of '>' but it did not do anything. | |
* I assume time() does not work when comparing to date becuase the date starts at 0:00, so anytime on the current day will be past 0:00 | |
*/ | |
$args = array( | |
'post_type' => 'event', | |
'meta_key' => '_event_date', | |
'orderby' => '_event_date', | |
'order' => 'asc', | |
'posts_per_page' => 3, | |
'meta_query' => array(array( | |
'key' => '_event_date', | |
'value' => time(), | |
'compare' => '>=' | |
)) | |
); | |
$events = new WP_Query($args); | |
get_header(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment