Custom category markers not working
-
Have added the following to my functions.php file as a proof of concept, as I have 1 placemarker which assisgned only to my ‘shop’ category:
function setBGMPDefaultIconByCategory( $iconURL, $placemarkID ) { $placemarkCategories = wp_get_object_terms( $placemarkID, 'bgmp-category' ); foreach( $placemarkCategories as $pc ) if( $pc->slug == 'shop' ) { $iconURL = 'https://www.gravatar.com/avatar/1cf0770522223715996d00a7fe911003?s=48&d=monsterid&r=g'; } else { $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/img/map_marker_generic.png'; } return $iconURL; } add_filter( 'bgmp_default-icon', 'setBGMPDefaultIcon', 10, 2);
No markers at all are showing on my map, and I’m getting error messges for each placemark:
bgmp_createMarker(): Postname icon wasn't passed in.
I’ve tried disabling all other plugins and switching to default theme.
Running locally on MAMP but can upload if it helps.
Guess I must be missing something obvious?
https://www.ads-software.com/extend/plugins/basic-google-maps-placemarks/
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘Custom category markers not working’ is closed to new replies.