{"id":10100176,"date":"2018-03-21T17:05:24","date_gmt":"2018-03-21T17:05:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/how-to-modify-the-custom-unique-marker-code\/"},"modified":"2018-03-21T17:05:59","modified_gmt":"2018-03-21T17:05:59","slug":"how-to-modify-the-custom-unique-marker-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/how-to-modify-the-custom-unique-marker-code\/","title":{"rendered":"How to modify the custom unique marker code?"},"content":{"rendered":"<p>Hello i am trying to set different marker for each category.<br \/>\nI already look there https:\/\/wpstorelocator.co\/document\/set-unique-category-markers\/<br \/>\nI use the shortcode [wpls]to show the map on a page.<\/p>\n<p>I do not understand how to modify the following code with my category and my custom pointer. Let&#8217;s say the pointer is located in \/wp-content\/pointer\/specialpointer.png and the category name is &#8220;mycategory&#8221;<br \/>\nCategory images plugin is already installed and working.<\/p>\n<p>How do i modify the following code? And will be this enough? Thanks to everybody will help me in this!<\/p>\n<pre><code>add_filter( &#039;wpsl_cpt_info_window_meta_fields&#039;, &#039;custom_cpt_info_window_meta_fields&#039;, 10, 2 );\n\nfunction custom_cpt_info_window_meta_fields( $meta_fields, $store_id ) {\n\n    $terms = wp_get_post_terms( $store_id, &#039;wpsl_store_category&#039; );\n\n    if ( $terms ) {\n        if ( !is_wp_error( $terms ) ) {\n            if ( function_exists( &#039;z_taxonomy_image_url&#039; ) ) {\n                $meta_fields[&#039;categoryMarkerUrl&#039;] = z_taxonomy_image_url( $terms[0]-&gt;term_id );\n            }\n        }\n    }\n\n    return $meta_fields;\n}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-10100176","topic","type-topic","status-publish","hentry","topic-tag-custom-marker","topic-tag-function-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10100176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10100176\/revisions"}],"predecessor-version":[{"id":10100177,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10100176\/revisions\/10100177"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10100176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}