Make location switcher default to Country

This topic contains 4 replies, has 4 voices, and was last updated by  Alex Rollin 5 years, 8 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #443889

    Benjamin
    Full Member
    Post count: 67

    Hello,

    I was wondering if there was a way, or some code, to make it so when you go to a page with the location switcher on it ([gd_location_tab_switcher]), it will always default to the selected dropdown being the country tab. As it is now, when loading a new page it’ll have the active tab be the ‘city’ tab, and we’d much rather have the country tab be the default.

    Thanks for any help!

    #443911

    Paolo
    Site Admin
    Post count: 31206

    I don’t think that is possible, but I asked to the developers to let us know if they can think of any workaround.

    Thanks

    #444144

    Kiran
    Moderator
    Post count: 7069

    Hello Benjamin,

    Try following code snippet to get country tab by default selected.

    
    
    
    /* Location switcher default tab */
    function _gd_custom_location_switcher_default_tab( $default_tab ) {
    	$default_tab = 'country'; // country, region, city, neighbourhood (if active)
    	return $default_tab;
    }
    add_filter( 'geodir_location_switcher_default_tab', '_gd_custom_location_switcher_default_tab', 10, 1 );
    

    Kiran

    #444204

    Benjamin
    Full Member
    Post count: 67

    Thanks! This worked great.

    #444212

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
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