• I want to sort with distance and city or only with city.
    I don′t know how to use this code in my functions.php

    apply_filters( 'gmw_pt_location_query_clauses', $clauses, $this->form );

    and which parameter I must change ?
    I have tried this code in my functions.php

    function gmw_pt_custom_orderby_query( $query_args, $form ) {
       // verify that we are in page load results query.
    	if ( empty( $form['page_load_action'] ) ) {
    		return $query_args;
    	}
     
    	$query_args['orderby'] = city';
    	$query_args['order']   = 'ASC';
     
    	return $query_args;
    }
    add_filter( 'gmw_pt_search_query_args', 'gmw_pt_custom_orderby_query', 99, 2 );
  • The topic ‘orderby with city and distance’ is closed to new replies.