WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic Google Maps
[resolved] Custom markers (8 posts)

  1. maxj
    Member
    Posted 1 year ago #

    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/

  2. maxj
    Member
    Posted 1 year ago #

    hello, no answer yet but I found a solution: http://wordpress.org/extend/plugins/php-code-for-posts/

  3. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    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

  4. maxj
    Member
    Posted 1 year ago #

    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.

  5. maxj
    Member
    Posted 1 year ago #

    One more question on that one.
    I can use that exemple 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.

  6. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

  7. maxj
    Member
    Posted 1 year ago #

    Thank You.
    I wounder if it is possible to change a icon (for mashupmap) when I'm using a shortcode?

  8. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.