Created
November 21, 2014 14:51
-
-
Save jesseeproductions/ebc7fbaa44f2ce336dbe to your computer and use it in GitHub Desktop.
The Events Calendar Get Count of Future Events
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
/* | |
* The Events Calendar Get Count of Future Events | |
* | |
* @3.8.1 | |
*/ | |
$args = array( | |
'post_type' => 'tribe_events', | |
'meta_query' => array( | |
array( | |
'key' => '_EventStartDate', | |
'value' => date('Y-m-d') . ' 00:00:00', | |
'compare' => '>=' | |
) | |
) | |
); | |
$event_count= new WP_Query( $args ); | |
echo $event_count->post_count; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there!
Would you tell me please where should it be inserted to work well?
Thanks.