Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

[Resolved]Sort All Results by City

Forums F.A.Q Sort All Results by City

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36268
    Digital
    Member

    Hi,

    Sorry to keep posting at the moment… when displaying all results before a search, is it possible to sort them by City alphabetically? Since City is stored in the GMW database I wasn’t sure if it is possible to access it and use it directly?

    Otherwise I can just output the loop to an array first (getting city using do_shortcode(‘[gmw_post_info info=”city”]’) ), sort the array, then output to the page. Just wanted to check there wasn’t a better way?

    Thanks.

    #36460

    Hi Steph,

    Sorry to keep posting at the moment…

    That is not a problem. Feel free to post as manny questions you might have.

    s it possible to sort them by City alphabetically?

    Try the below script ( in functions.php file ):

    #37162
    Digital
    Member

    Thanks Eyal, that’s brilliant.

    In case anyone else is doing this – I just wrapped it in an if( !isset($_GET['action']) ) {} statement to make it only apply when displaying all results initially, and not when a user has done search based on a location – the standard sort by location takes over here.

    #59833
    Will Read
    Member

    Hi Eyal,

    It looks like the gmw_pt_location_query_clauses filter no longer exists in the latest version of the plugin. What’s the right way to sort the results by city (or state) now?

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.