Hi Rad,
that sounds like the perfect solution for me. I only have a problem with that code that I have to place inside of the functions.php.
I created a new Custom Meta for the timestamp to sort the events. That worked well. But when I copy the code into my functions.php (with the grid number changed to mine) it doesn’t show any event. I’ve integrated it like that:
add_filter('essgrid_query_caching', 'eg_stop_caching', 10, 2);
add_filter('essgrid_get_posts', 'eg_mod_query', 10, 2);
// turn off caching for your grid
function eg_stop_caching($do_cache, $grid_id) {
if($grid_id == 25) return false;
return true;
}
function eg_mod_query($query, $grid_id){
// show only upcoming events in the future
if($grid_id == 25){
$query['meta_query'] = array( 'key' => '_start_ts', 'value' => current_time('timestamp'),
'compare' => '>=', 'type'=>'numeric' );
$query['meta_key'] = '_start_ts';
$query['meta_value'] = current_time('timestamp');
$query['meta_value_num'] = current_time('timestamp');
$query['meta_compare'] = '>=';
}
return $query;
}
I removed it for the moment so that the events are there again. May you see my mistake here?
I really appreciate your efforts and your patience.
Best, Christian