Howdy Yann,
Welcome to our support forums and thanks for reaching out to us!
I think the best way to tweak this would be to modify the query before it get’s the posts. This snippet will surely get you on the right path:
add_action( 'tribe_events_pre_get_posts', 'upcoming_two_weeks' );
function upcoming_two_weeks( $query ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $query->get('eventDisplay') == 'map' ) {
$end_time = strtotime('+2 weeks');
$end_date = date("Y-m-d G:i:s", $end_time);
$query->query_vars['meta_query'][] = array('key' => '_EventStartDate', 'type' => 'DATETIME', 'compare' => '<', 'value' => $end_date);
}
return $query;
}
Add this code to your functions.php file -located at wp-content/themes/your_theme/- and you should see Map view upcoming events limited to two weeks from the current date. Haven’t fully tested it, but seems to work fine!
Please let me know if you can implement this fix,
Best,
Nico