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

Home Forums Bug Reports Order alphabetically but then by distance

This topic contains 2 replies, has 2 voices, and was last updated by  Alan Green 3 years, 6 months ago.

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

    Alan Green
    Participant

    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

    Eyal Fitoussi
    Keymaster

    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
    Participant

    Works perfectly. Thanks for this 🙂

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

You must be logged in to reply to this topic.