Close the map on page load


In this tutorial, you’ll see how to close the map on page load.

Edit the file “functions.php” of your theme/child theme and copy/paste the following code:

function cspm_close_map_onload(){
	
	wp_add_inline_script("cspml-script", 
	   "setTimeout(function(){
			jQuery('div.cspml_resize_map').trigger('click'); 
		}, 500);"
	);
		
}
add_action('cspml_before_enqueue_script', 'cspm_close_map_onload');

In the same context