• Resolved steighne

    (@steighne)


    Hi Codepeople ??
    I’d love to filter/hook a way to use a marker based on the category or taxonomy…
    e.g. MarkerA if TaxonomyA, MarkerB if TaxonomyB, etc.

    Is there any documentation on how to do this, most likely in my child theme’s functions.php file?

    Owned the pro version for years and love it–thanks for this plugin.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter steighne

    (@steighne)

    Hi @codepeople
    Brilliant. That works like a charm. You’re a legend. Managed to get this to work

    function edit_point($point)
    {
        if(has_term('MyTermA','MyTax',($point['post_id'])) || has_term('MyTermB','MyTax',($point['post_id']))) {
    	$point['icon']= get_stylesheet_directory_uri() . '/images/icons/IconFoo.png';
        } elseif(has_term('MyTermB','MyTax',($point['post_id']))) {
    	$point['icon']= get_stylesheet_directory_uri() . '/images/icons/IconBar.png';
        } else {
    	$point['icon']= get_stylesheet_directory_uri() . '/images/icons/default.png';
        }
    	return $point;
    }
    add_filter('cpm-point', 'edit_point', 10);
    Plugin Author codepeople

    (@codepeople)

    Hello @steighne

    Excellent !!! Thank you very much for sharing your code.

    Best regards.

    Thread Starter steighne

    (@steighne)

    @codepeople Thanks for all of your time (and the update!).
    Love the plugin ??

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Map Marker based on Tax or Cat’ is closed to new replies.