Forum: Bug Reports

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]Order alphabetically but then by distance

Forums Bug Reports Order alphabetically but then by distance

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #53775
    Alan Green
    Member

    I’m using the following function, that I found in another support post here:

    Which works great, however when I then perform a search and the results are shown, they are still shown alphabetically as opposed to by distance.

    Any ideas how we can get both working as when the user first enters the page without performing a search it makes far more sense to show by A-Z but after search more sense by distance.

    #53838

    Hello Alan,
    You can check if a form was submitted using

    So I believe that changing:

    if ( $gmw['ID'] == 2 ) {

    to

    if ( $gmw['ID'] == 2 && !$gmw['submitted'] ) {

    should work.

    I hope that helps.

    #53843
    Alan Green
    Member

    Works perfectly. Thanks for this 🙂

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

You must be logged in to reply to this topic.