• giosko

    (@giosko)


    Hello i am trying to set different marker for each category.
    I already look there https://wpstorelocator.co/document/set-unique-category-markers/
    I use the shortcode [wpls]to show the map on a page.

    I do not understand how to modify the following code with my category and my custom pointer. Let’s say the pointer is located in /wp-content/pointer/specialpointer.png and the category name is “mycategory”
    Category images plugin is already installed and working.

    How do i modify the following code? And will be this enough? Thanks to everybody will help me in this!

    add_filter( 'wpsl_cpt_info_window_meta_fields', 'custom_cpt_info_window_meta_fields', 10, 2 );
    
    function custom_cpt_info_window_meta_fields( $meta_fields, $store_id ) {
    
        $terms = wp_get_post_terms( $store_id, 'wpsl_store_category' );
    
        if ( $terms ) {
            if ( !is_wp_error( $terms ) ) {
                if ( function_exists( 'z_taxonomy_image_url' ) ) {
                    $meta_fields['categoryMarkerUrl'] = z_taxonomy_image_url( $terms[0]->term_id );
                }
            }
        }
    
        return $meta_fields;
    }
    • This topic was modified 7 years ago by giosko.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    The way it works now is that it will automatically grab the uploaded category image, and use that as the marker image. What do you like it to do instead?

    Thread Starter giosko

    (@giosko)

    Hello Tjmen and thanks for the answer!

    You can check on this page the map –> https://bit.ly/2FZCf4R
    The store that you see in “Rome” is assigned to the category “onlysport” and the pointer is loaded with categories image plugin. Here is a screenshot –> https://ezviz.addlab.it/wp-content/uploads/cat-image.png

    Any way to fix? ??

    Thread Starter giosko

    (@giosko)

    I went for a premium plugin, anyway i will just one time point out that the “marker” from category are not working at the moment out of the box.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to modify the custom unique marker code?’ is closed to new replies.