Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Created November 21, 2014 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseeproductions/ebc7fbaa44f2ce336dbe to your computer and use it in GitHub Desktop.
Save jesseeproductions/ebc7fbaa44f2ce336dbe to your computer and use it in GitHub Desktop.
The Events Calendar Get Count of Future Events
/*
* 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;
@AlexeyGonchar
Copy link

Hi there!

Would you tell me please where should it be inserted to work well?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment