How to Change the Marker Cluster Images?

It is possible to change the default Marker Cluster images to something of your own preference. 

Changing Marker Cluster Images/Icons

All Marker Cluster images or icons are loaded from  \wp-content\plugins\geodir_marker_cluster\assets\images\ directory. As such, you need to add your new image/icon files in the same directory. 

1
For instance, let's say you have five icon files, namely, m1.png, m2.png, m3.png, m4.png, m5.png -- you now need to upload these files to the above specified directory via SFTP. 
2
Next, you need to change the path to Cluster icons and specify the path to the new ones that you uploaded. Add the following PHP snippet to your functions.php file (or, preferably, you can use the Code Snippets plugin): 
function gd_snippet_marker_cluster_image_path( $icon_path = '' ) {
	$icon_path = 'https://www.mysite.com/assets/images/m'; // Change image path here  
	return $icon_path;  }  

add_filter( 'geodir_marker_cluster_image_path', 'gd_snippet_marker_cluster_image_path', 10, 1 );

Remember to replace mysite.com with your actual site address, and the image names with the actual file names that you uploaded. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us