Search Radius Not Working

This topic contains 37 replies, has 5 voices, and was last updated by  edge 5 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #452106

    edge
    Buyer
    Post count: 191
    This reply has been marked as private.
    #452118

    edge
    Buyer
    Post count: 191
    This reply has been marked as private.
    #452121

    Kiran
    Moderator
    Post count: 7069

    Hello,

    For distance sorting it always shows nearest to first. If you featured + nearest at first, then add following snippet in your child theme functions.php

    
    
    function gd_snippet_sort_featured_first( $orderby, $sort_by, $table ) {
        if ( $sort_by == 'nearest' || $sort_by == 'farthest' ) {
    		$orderby = $table . ".is_featured asc, " . $orderby;
    	}
        return $orderby;
    }
    add_filter( 'geodir_posts_order_by_sort', 'gd_snippet_sort_featured_first', 1000, 3 );

    Kiran

    #452190

    edge
    Buyer
    Post count: 191

    Hi Kiran,

    I have added the above code in my functions.php but its showing 500 error my website stops working and when i remove the code than website is working fine.Can you please have a look.

    Thanks

    #452191

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Please check now. Semicolon was missing at the end of line in snippet. I have fixed it and updated in file.

    Kiran

    #452192

    edge
    Buyer
    Post count: 191

    Hello Kiran,

    It is working fine.Thanks for your hardwork and cooperation.One last question in which file you have added radius distance patch I want to move this on my live server.

    Thanks for your hardwork again.

    #452193

    Kiran
    Moderator
    Post count: 7069

    To update changes to live site, copy file plugins\geodirectory\geodirectory-functions\listing_filters.php from staging site to your live site.

    #452195

    edge
    Buyer
    Post count: 191

    OK,Thanks for your help.

Viewing 8 posts - 31 through 38 (of 38 total)

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

Open Support Ticket