• 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 6 years, 8 months ago by giosko.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to modify the custom unique marker code?’ is closed to new replies.