Map View in Events Calendar Pro displays your events as an interactive map, pairing geographic visualization with event details. If you’d like to adjust how events appear or how the view behaves, a small snippet can help. This article collects Map View customizations that go beyond what the standard settings allow.
Customizations for The Events Calendar are usually implemented via code snippets or template overrides. Add snippets to your child theme’s functions.php file or use the Code Snippets plugin. Template overrides should go in a child theme. If either approach is new to you, start with Using Code Snippets to Customize The Events Calendar and Customizing The Events Calendar Templates for a walkthrough of each.
Changing the Number of Events per Page on Map View
The Map View in Events Calendar Pro provides an interactive platform to display your events, combining geographical visualization with event details.
By default, the number of events displayed per page in this view is determined by the setting found under Events > Settings > Display > Calendar tab > Number of events to show per page. Adjusting this setting allows you to control how many events are listed per page across various views, including the Map View. However, there may be instances where you want the Map View to display a different number of events per page than other views. Adding the following snippet to your site does the exact thing for you:
// Increase/Decrease Events Shown in Map View
add_filter( 'tribe_events_views_v2_view_map_repository_args', function( $args, $context ) {
$args['posts_per_page'] = 4 ;// Change this number to your choice
return $args;
}, 10, 2);
That’s all, by implementing the above code, 4 events per page will be loaded on Map View.