Map Bubble CPT css?

This topic contains 4 replies, has 3 voices, and was last updated by  Joy 4 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #540834

    Joy
    Buyer
    Post count: 1076

    Hello! I am using the following snippet to change the formatting of the map bubble addresses:

    add_filter("geodir_show_listing_info","_my_map_address_add",10,2);
    function _my_map_address_add($html,$fields_location){
    
    if($fields_location=='mapbubble'){
    $html = do_shortcode('[gd_post_address show="icon-label-value" address_template="%%post_title%% %%post_title_br%% :: %%street_br%% %%neighbourhood_br%% %%city_br%% %%region_br%% %%zip_br%% %%country%%"]').$html;
    }
        return $html;
    }

    Can css be used to target post types? I only want the address to be shown this way on one type – on the other type I have, no address is necessary. But using this snippet “forces” an address in the map bubble and overrides the cpt field settings. Or can this snippet be adjusted to only change the address and override the field settings for a specific cpt? Thank you very much!

    #540880

    Kiran
    Moderator
    Post count: 7069

    Hi Joy,

    We have allowed to customize map popup template for each post type. It will be in next release of v2.0.0.90.

    Try this patch https://github.com/AyeCode/geodirectory/pull/1159/commits/e804523b96e913ffcd83b5492f649bf7233fbd5b

    Now you can use template for different post type with name map-popup-POSTTYPE.php.

    Example:
    To customize template for “gd_place” post type map popup you have to copy template file from /plugins/geodirectory/templates/map-popup.php to /YOURTHEME/geodirectory/map-popup-gd_place.php

    Let us know.

    Regards,
    Kiran

    #541693

    Joy
    Buyer
    Post count: 1076

    Thank you for the update Kiran. With the next release will we still need to create a custom template file or will the template option setting be available within the WP Dashboard?

    #541713

    Alex Rollin
    Moderator
    Post count: 27815

    The change allows an easy way to name the files for customizing. There won’t be a dashboard option. The map popup is difficult to work with as a page template because it has to follow very strict handling in order to work with the APIs and cache.

    #541768

    Joy
    Buyer
    Post count: 1076

    Okay, thanks for the clarification.

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount