• gomez217

    (@gomez217)


    I’m currently on an internal DEV server, so I can ‘Share’ what I’m speaking of, but is there a way to ensure that the results list gives a MINIMUM of 5 results, regardless of pre-set radius?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    There’s no build in way to do this, but if your comfortable with code, then I can point you in the right direction how to do this. But it will involve changing the SQL query a bit.

    Thread Starter gomez217

    (@gomez217)

    @tijmensmit – going code would be GREAT! Comfortable enough yes, and it would really save the project.

    Thread Starter gomez217

    (@gomez217)

    @tijmensmit – if you would like to PM me the necessary code/location, just let me know.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Sorry for not getting back to you before, clearly overlooked this one.

    I misunderstood your initial question, the code I have will regardless of the set radius return 5 ( or whatever ) rows, not less or more. This is part of the next update where if no results are found it will show a text asking the user if they want to see the x nearest locations regardless of the search radius.

    If that works as well for you, then I can explain how to make it work that way with the wpsl_sql filter.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    A search on Stack overflow showed me this thread with HAVING COUNT to set a minimum value.

    I didn’t test it, but HAVING COUNT( posts.ID ) > 5 should do it in combination with the wpsl_sql filter. Here is the existing SQL query that you can overwrite with the filter.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Setting Minimum Results’ is closed to new replies.