Set an absolute near me location value
This topic contains 9 replies, has 3 voices, and was last updated by Stiofan O’Connor 8 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
March 16, 2017 at 10:55 am #367657
Hi
How can I set the near me location to always be from the same location.
I am creating an accommodation listing for a major event.
Users will want to see the distance from the accommodation to the event and will not be interested in any other distance measurement.
If i could somehow set the near me value and then hide the field by positioning it off screen with css that would be great.
Is there perhaps a function I can use to set this loction?
Brendan
March 16, 2017 at 12:32 pm #367680The only thing I can think off is to add a custom field where you add distance details manually when creating the listings.
I’ll get the others to have a look too, maybe they can think of a simple way, without having to get a special customization.
ThanksMarch 16, 2017 at 12:53 pm #367688Having a user enter their own distance manually would mean that the distance might not be accurate, as they would be guessing.
Whereas if the distance is worked out by google api it would be accurate and I like the way it can be filtered in the advanced search option too.
If you can come up with a solution that would be great. And I think it might be a really good feature for ye to add to the plugin.
Thanks
BrendanMarch 16, 2017 at 3:07 pm #367762Hi Brendan,
Where exactly do you want to show it?, are you wanting to show distances as the crow flies or Google maps directions distances?
Stiofan
March 17, 2017 at 2:20 pm #368092This reply has been marked as private.March 17, 2017 at 3:00 pm #368104Hi Brendan,
Happy Paddy’s Day 🙂
That is a search page, i thought you wanted the distances to show throughout the site and not just the search page?
I actually do something similar on one of my own sites but with two locations, how close to the airport and how close to the biggest town, i usually enter these distances manually. I think we could create a new custom field that would do this for you, maybe we just enter the GPS coordinates and it will calculate it and show it, then it will show everywhere and not just on the search page, how does that sound?
Stiofan
March 17, 2017 at 3:48 pm #368117Happy Paddy’s Day to you too Stiofan
I’m watching the Club All Ireland Hurling on the TV and trying to get in a bit of work too. That’s my Paddy’s Day.
I hadn’t thought about showing the distances throughout the site, but that would be great.
So, yes please.
Slainté
BrendanMarch 17, 2017 at 5:59 pm #368141I did a small blog post about your need and added the code there, if you need help implementing it just let me know: https://wpgeodirectory.com/distance-custom-field/
Thanks,
Stiofan 🙂
March 20, 2017 at 12:38 pm #368563Thanks Stiofan
That worked really well for me to display on the listing.
However, I still need it to be filterable to show ascending order by distance.
I changed the ‘cat_sort’ => false to true
and turned it on in custom fields and placed it in sorting options, but I still don’t see it on the front end in search.
What else do I need to do
Brendan
March 20, 2017 at 1:16 pm #368575Hi Brendan,
This will not automatically sort by distance, that feature is done in search though, maybe a direct link placed where you need it to the search results page would do what you need?
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket