Use marker popups to display the post ID


In this tutorial, you’ll see how to display the ID of each post/location inside the marker popup.

  1. Edit your map.
  2. Click on the menu “Marker popups settings”.
  3. Select the option “Use marker popups => Yes”.
  4. Edit the file “functions.php” of your theme/child theme and copy/paste the following code in it:
/**
 * Use marker popups to display the post ID 
 */
function cspm_post_ID_popup($content, $map_id, $post_id){
	
	return $post_id;
	
}
add_filter('cspm_marker_popup_content', 'cspm_post_ID_popup', 10, 3); 

In the same context