Title: Custom markers
Last modified: August 20, 2016

---

# Custom markers

 *  Resolved [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/custom-markers/)
 * Hi; i did add that code:
 *     ```
       /**
        * Filter snippet
        */
       function prefix_pronamic_google_maps_marker_options_icon( $url ) {
       	switch ( get_post_type() ) {
       		case 'my_type':
       			return 'http://google-maps-icons.googlecode.com/files/seniorsite.png';
       		case 'my_other_type':
       			return 'http://google-maps-icons.googlecode.com/files/university.png';
       	}
   
       	return $url;
       }
   
       add_filter( 'pronamic_google_maps_marker_options_icon', 'prefix_pronamic_google_maps_marker_options_icon' );
       ```
   
 * to my functions.php but it dsn’t working. I was tryig with my own icon as well
   but nothing helps…Can somebody please help me?
 * [http://wordpress.org/extend/plugins/pronamic-google-maps/](http://wordpress.org/extend/plugins/pronamic-google-maps/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/custom-markers/#post-3227334)
 * hello, no answer yet but I found a solution: [http://wordpress.org/extend/plugins/php-code-for-posts/](http://wordpress.org/extend/plugins/php-code-for-posts/)
 *  Plugin Author [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/custom-markers/#post-3227335)
 * I’m not sure how you used the “PHP Code for posts” plugin to solve the issue.
   The following example should work in the development version of our plugin:
 * [https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-post-type-a-b-marker-icon.php](https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-post-type-a-b-marker-icon.php)
 * [https://github.com/pronamic/wp-pronamic-google-maps](https://github.com/pronamic/wp-pronamic-google-maps)
 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/custom-markers/#post-3227336)
 * Hi, I did use that code in my functions.php file but it wasn’t working at all.
   I was trying to use that filter snippet in three different wordpress installation
   but just can’t get it work.
    I could not use template code because I’m using 
   types and views plugin and it is impossible to put raw php code in a view template
   thats why I’m using the other plugin to do taht; I find it a little bit complicated
   but it’s better than nothing.
 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-markers/#post-3227410)
 * One more question on that one.
    I can use that exemple [](https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-post-type-a-b-marker-icon.php)
   and it works fine for different post types but now I would like my icons to depend
   on custom taxonomies and for example if a post has a taxonomy ‘camping’ I want
   to use one icon but if it is a B&B I want a bb icon. Is it possible? I was trying
   but without success.
 *  Plugin Author [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-markers/#post-3227411)
 * You could use this example:
 * [https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-categories-fixed-marker-icon.php](https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-categories-fixed-marker-icon.php)
 * Instead of using ‘has_category’ you can use ‘has_term’:
    [http://codex.wordpress.org/Function_Reference/has_term](http://codex.wordpress.org/Function_Reference/has_term)
 * You could also use a more dynamic approuch:
    [https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-categories-dynamic-marker-icon.php](https://github.com/pronamic/wp-pronamic-google-maps/blob/master/examples/mashup-categories-dynamic-marker-icon.php)
 * Instead of using ‘get_the_category’ you can use ‘get_the_terms’:
    [http://codex.wordpress.org/Function_Reference/get_the_terms](http://codex.wordpress.org/Function_Reference/get_the_terms)
 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-markers/#post-3227412)
 * Thank You.
    I wounder if it is possible to change a icon (for mashupmap) when
   I’m using a shortcode?
 *  Plugin Author [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-markers/#post-3227413)
 * I think it works with one of the filters in the example, did you tried this? 
   Please start another topic if you have another issue.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom markers’ is closed to new replies.

 * ![](https://ps.w.org/pronamic-google-maps/assets/icon-256x256.png?rev=3194044)
 * [Pronamic Google Maps](https://wordpress.org/plugins/pronamic-google-maps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pronamic-google-maps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pronamic-google-maps/)
 * [Active Topics](https://wordpress.org/support/plugin/pronamic-google-maps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pronamic-google-maps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pronamic-google-maps/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/custom-markers/#post-3227413)
 * Status: resolved