How can I reset the search filter when changing languages?

This topic contains 32 replies, has 3 voices, and was last updated by  Alexander Krutov 5 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #506191

    Alexander Krutov
    Expired Member
    Post count: 652
    This reply has been marked as private.
    #506193

    Kiran
    Moderator
    Post count: 7069

    Try this.

    
    
    function gd_snippet_20190903_wpml_language_page_url( $page_url, $page_id, $lang_code ) {
    	global $sitepress, $geodirectory;
    
    	if ( $sitepress->get_default_language() != $lang_code && absint( geodir_location_page_id() ) == $page_id ) {
    		if ( ! empty( $geodirectory->location->country_slug ) && ! empty( $geodirectory->location->region_slug ) ) {
    			$_page_url = explode( "/" . $geodirectory->location->country_slug . "/", $page_url, 2 );
    
    			if ( count( $_page_url ) == 2 ) {
    				$page_url = $_page_url[0] . '/' . $geodirectory->location->country_slug . '/';
    			}
    		}
    	}
    
    	return $page_url;
    }
    add_filter( 'geodir_wpml_language_page_url', 'gd_snippet_20190903_wpml_language_page_url', 20, 3 );

    Kiran

    #506195

    Alexander Krutov
    Expired Member
    Post count: 652

    It’s working! Thank you!

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