Sauter la navigation

[Fermé] Map View – Need to Scale Result Limit with Search Area…

This support ticket is created Il y a 2 années et 8 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Minesh Il y a 2 années et 8 mois.

Assisté par: Minesh.

Auteur
Publications
#2361125

Tell us what you are trying to do?
Because Views "Display [x] Items" only goes to 50 or No Limit, I have an add_filter function using $view_settings['limit'] = '[x]' line to change the limit to a custom number... BUT... it falls a bit short of what I need...

When a user is searching 60 miles, 75 results should be more than enough, but when they search 600 miles, I might want 300 results and if they're searching 1600 miles I might want No Limit.

As it is though they can widen the search to the whole planet and only get the static number of results set with the function.

Please understand I don't want to "Display [No Limit]" or an arbitrarily high number across the board because that will take a very long time for all searches, and the vast majority of users will only be searching small areas. But for those users wanting to search locations nationwide or worldwide, I'd like to give them an appropriate amount of results.

So I'm thinking there's some way to get the "show results with [x]" amount in that function so I can set an if statement or switch statement or something along those lines.

Hoping support can provide some ideas here.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
lien caché

What is the link to your site?
lien caché

#2361533

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

When I try to access the problem URL you shared: lien caché

I can see its throwing the error :

Forbidden
You don't have permission to access this resource.

As I understand, you want to change the number of posts to be displayed at a time based on the distance search miles input?

#2362805

Correct Minesh.

The error is actually a firewall. If you send me your IP address I can whitelist you.

But yes, your understanding is correct, I want augment my function so that as the distance changes, the amount of results (posts) being looped by the view changes.

Of course, I'm open to alternative suggestions. It may be that there is a better way of setting this, but please take a look at the view (and nested views) in the web page to start and if needed I can better describe the structure.

#2364181

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

My current IP is: 49.36.65.150 but meanwhile you whitelist me there is a possibility that it might be changed as I'm having dynamic IP.

Will you able to setup a staging site on another server where there will be no IP restrictions?

Le sujet ‘[Fermé] Map View – Need to Scale Result Limit with Search Area…’ est fermé à de nouvelles réponses.