Search for specific list will not zoom the map in search

This topic contains 4 replies, has 2 voices, and was last updated by  Bkbai 8 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #58276

    Bkbai
    Buyer
    Post count: 56

    I don’t know if this is just happening on my site or is a generic stuff but…

    When searching for something specific were you just get 1 result the map show very far away (in the world 😉

    It may be a config stuff that I missed

    Any idea?
    Thanks

    #58308

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    if you have the autozoom on and only 1 listing, it will use the default zoom level you set in the widget.

    Let us know if this helps.

    Thanks

    #58315

    Bkbai
    Buyer
    Post count: 56

    YES!
    Thats exactly what I was missing
    But I found that is much better (in my case) to open the listing directly

    
    
    add_action( 'template_redirect', 'single_result' );
    function single_result() {
        if ( is_search( )) {
            global $wp_query;
            if ( $wp_query->post_count == 1 ) {
                wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
            }
        }
    }

    Once again thanks Paolo

    #58316

    Paolo
    Site Admin
    Post count: 31206

    You are welcome and thanks for the tip… Could be useful for other members too.
    🙂

    #58318

    Bkbai
    Buyer
    Post count: 56

    That’s why I post it 😉 Hope it will > Share is love 😛

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