blank Search page loads all listings on map (Listimia)

This topic contains 2 replies, has 2 voices, and was last updated by  Foster 5 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #509822

    Foster
    Full Member
    Post count: 164

    Hello,

    If I navigate directly to my Search page, the map is loading all listings. This seems to be unnecessarily slowing down the page.

    Is there a way to only load the map once a search has taken place? Or preferably to have a blank map?

    my-domain.net/search

    Thanks

    #509835

    Guust
    Moderator
    Post count: 29970

    The map is trying to load all listings because it has the attribute

    all_posts="1"

    assigned.
    Change that to

    all_posts="0"

    or remove it from the shortcode or other element type.
    I don’t know how Listimia’s pages are created, but look for something like

    [gd_map zoom="0" map_type="archive" all_posts="1"]

    Thanks

    #509959

    Foster
    Full Member
    Post count: 164

    Solution:

    // Display the map
    function My_Map_Function($map_shortcode) {
    global $post;

    $page_template = get_page_template_slug($post->ID);
    if ( $page_template ==’page-templates/search.php’) {
    $map_shortcode= do_shortcode(‘[gd_map width=”100%” height=”100vh” maptype=”ROADMAP” zoom=”0″ map_type=”auto” marker_cluster=”true” all_posts=”1″]’);
    }
    return $map_shortcode;
    }
    add_filter( ‘listimia_display_map’, ‘My_Map_Function’,’20’, ‘1’);

Viewing 3 posts - 1 through 3 (of 3 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