Comments 2laboulbene started the conversationMay 27, 2020 at 6:16pmHi,is there a way to replace on the map view, the squared icons for categories by a png icon ?it is essential for me to get custom icons for categories.Thanks by advanceLudovic 877Zhivko repliedMay 28, 2020 at 9:41amHi,It's possible via filter.Place the code in your theme functions.php file: add_action('wp_footer', function() { ?> <script type="text/javascript"> (function($){ if (typeof $.stecExtend === 'undefined') { return; } $.stecExtend(function(m){ m.$instance.on('stecMapMarkerIcon', function(e, data){ // Custom map icon image var image = 'http://...'; data.temp.stecMapMarkerIcon = image; }); }); })(window.jQuery); </script> <?php}); Make sure to enter correct url to your png image. Stachethemes Developer 2laboulbene repliedMay 28, 2020 at 1:14pmWorks fine, thank you very much :-)It seems that code replace the square for categories by the desired image.Is there a way to duplicate a part of that code to have the ability tu setup a personal image for each category using category #id for example ?Thanks in advance,Ludovic 877Zhivko repliedMay 28, 2020 at 1:22pmYes, via switch. add_action('wp_footer', function() { ?> <script type="text/javascript"> (function ($) { if (typeof $.stecExtend === 'undefined') { return; } $.stecExtend(function (m) { m.$instance.on('stecMapMarkerIcon', function (e, data) { var image = 'http://...'; // default image var firstCategoryId = data.event.category.length > 0 ? data.event.category[0].id : false; switch (firstCategoryId) { case 20: image = 'http://...'; // image for category id # 20 break; case 19: image = 'http://...'; // image for category id # 19 break; } data.temp.stecMapMarkerIcon = image; }); }); })(window.jQuery); </script> <?php}); Stachethemes Developer 2laboulbene repliedMay 28, 2020 at 1:52pmIt is awesome ! thank you very much :-)have very nice day.Ludovic1 Like Sign in to reply ...
Hi,
is there a way to replace on the map view, the squared icons for categories by a png icon ?
it is essential for me to get custom icons for categories.
Thanks by advance
Ludovic
Hi,
It's possible via filter.
Place the code in your theme functions.php file:
Make sure to enter correct url to your png image.
Stachethemes Developer
Works fine, thank you very much :-)
It seems that code replace the square for categories by the desired image.
Is there a way to duplicate a part of that code to have the ability tu setup a personal image for each category using category #id for example ?
Thanks in advance,
Ludovic
Yes, via switch.
Stachethemes Developer
It is awesome ! thank you very much :-)
have very nice day.
Ludovic