Hide Address & Map based on package type

This topic contains 1 reply, has 2 voices, and was last updated by  Alex Rollin 6 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #423369

    Michelle
    Full Member
    Post count: 8

    I’ve tried for a few days and can’t get this to work. Using Supreme, I’d like to hide the address and map on the detail page.

    I’ve added this to show package ID and this part works!
    // add the package id to the body
    add_filter( ‘body_class’, ‘my_add_package_class’,10,1 );
    function my_add_package_class($class){
    global $post;
    if (geodir_is_page(‘detail’) && isset($post->package_id)) {
    $class[] = “gd-package-id-“.$post->package_id;
    }
    return $class;
    }

    I’ve also added to show full address at top of page and this works!

    add_filter(‘sd_details_output_address’, ‘modify_sd_details_output_address’);
    function modify_sd_details_output_address() {
    global $post;
    $sd_address = ‘<div class=”sd-address”>’;
    if (isset($post->post_address) && $post->post_address) {
    $sd_address .= apply_filters(‘sd_detail_address’, $post->post_address, $post);
    }
    if (isset($post->post_city) && $post->post_city) {
    $sd_address .= ‘<br/>’ . apply_filters(‘sd_detail_city_name’, $post->post_city, $post);
    }
    if (isset($post->post_region) && $post->post_region) {
    $sd_address .= ‘, ‘ . apply_filters(‘sd_detail_region_name’, $post->post_region, $post);
    }
    if (isset($post->post_zip) && $post->post_zip) {
    $sd_address .= ‘, ‘ . apply_filters(‘sd_detail_zip’, $post->post_zip, $post);
    }
    $sd_address .= ‘</div>’;

    return $sd_address;
    }

    NOW – I wand to hide address and map based on package types gd-package-id-24, gd-package-id-28 , etc.

    CAN anyone tell me what the CSS is to do this? I’ve tried to do this for a few days and can’t get it to work!

    Here is a listing that I’d like to hide address and map on https://foxchainguide.com/food_drink/johnsburg/restaurant/wave-bar-grille/

    Thanks!!

    #423524

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    You can try adding this custom CSS, and then customize it to your liking:

    
    
    
    .gd-package-id-24 .sd-address {
        display: none !important;
    }
    .gd-package-id-24 li#post_mapTab {
        display: none !important;
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

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

Open Support Ticket