Skip Navigation

[Resolved] Unable to display posts nearby? Is this currently possible?

This support ticket is created 5 years, 11 months ago. 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.

Our next available supporter will start replying to tickets in about 0.41 hours from now. Thank you for your understanding.

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)

This topic contains 27 replies, has 3 voices.

Last updated by Minesh 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#907604
views nearby filter attempt.png
nearby filter result.png
business nearby example.png

Tell us what you are trying to do?
I'm trying to display all the posts within a certain distance of the current post using views.
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/display-on-google-maps/ and the advanced page with the real estate site and creating a nearby filter
Is there a similar example that we can see?
See our screenshot - business nearby example - we've currently got the functionality using another plugin, but that's not a long term solution as we want to store locations in your custom fields and we're hoping to use it on at least 6 sites and don't want to pay the licencing for the other plugin on another 6 sites (which could potentially increase in number!) as well as looking to replace another full set of plugins (Geodirectory) on those sites.
What is the link to your site?
hidden link - you can see the section with the Businesses near that location - this is what we want to replicate in Toolset, we need it to display this without the user having to submit a location.

So far - this is what we've got in the Views: Screenshot - Views nearby filter attempt for the admin and the nearby filter result which shows the result - which is just the most recent posts rather than those within 15km (and there are posts within the distance). This widget will not be visible to you if you visit as it's only visible to admin.

I'm guessing that either I'm putting the wrong info into these fields : Distance center is set using URL parameter:
toolset_maps_distance_center and Distance center is set using shortcode attribute - I've tried using both fields and getting nowhere.

OR - that the nearby posts will only work when the user has to perform a search?

I've also a very quick question on formatting the output - if i invest in a compatible theme such as Divi theme, will the views created be formatted according to the theme?

BTW - I'm impressed with the functionality in your plugin - I've a huge learning curve ahead of me - especially with the forms - but I know that I'll end up with a robust solution for my website.

Thanks.

#907711

Toolset Maps distance Filter works on a given location or current location.
https://toolset.com/2018/02/toolset-maps-features-in-reference-sites-viewing-geolocation-and-filtering-by-distance-in-action/ > Searching near a specific location/GeoLocation

To automatically show posts in a certain distance from an address, you can use either a custom search which will allow the user to actively search - or you can pass the "center" in the Query Filter, so the user cannot actively search but just sees a list of posts around a certain center.

This could be done by passing the center in a ShortCode attribute, instead of the URL attribute:

Distance center is set using shortcode attribute: mapcenter

If you then, for example, insert this view to a post that has an address, and pass that posts' address as the ShortCode attribute, then you will see other posts, within a given distance from the current post.

I've also a very quick question on formatting the output - if I invest in a compatible theme such as Divi theme, will the views created be formatted according to the theme

Usually, you use Bootstrap when you use Toolset, not so with DIVI:
https://toolset.com/documentation/recommended-themes/toolset-divi-integration/matching-divi-styling-using-toolset/

With any theme listed here you will have additional options (coming from the Theme) to apply to your Content Templates (Or layouts, if supported):
https://toolset.com/documentation/recommended-themes/

#907949
Screenshot (6).png

Hi Beda,

Thanks for the reply. Glad to hear it's possible, just need to work out how.

I've already tried the above suggestion here - hidden link - and i'm actually getting a list returned with hundreds of posts - what appears to be all my site content! I've only got a handful of posts with a location in this field at present, but some of the posts it's returning are general posts that have no location data associated with them. Some of the others might have a lat/lon in a custom field or two, but as it's not looking at those fields - i doubt that's relevant.

I've also tried deleting and recreating the filter, and still not working for me?

I've added another screengrab with the filter settings. I've tried changing just about every field just in case there's a bug - but the result remains the same.

I've used the specific widget and I've pasted the shortcode below into both a plain text widget and directly into a post in case it was a widget issue - still the same result.

[wpv-view name="nearby" mapcenter="mapcenter"]

The geolocation field is definitely "address".

The only other thing I might need to mention is that i'm using another location plugin that also uses Google Maps - GeoMyWP - but I disabled that plugin and still getting the same result.

Let me know if you want any more specific information.

#908025

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - what if you try to use following shortcode:

[wpv-view name="nearby" mapcenter="[types field='address'][/types]"]

Where:
- You should pass an address field or our desired address.

#909577
Screenshot (7).png

Hi Minesh,

That's definitely done something - and I'm now getting some posts nearby to appear. But after a lot of tweaking, it appears to me that the ordering is causing a conflict.

I'm currently getting 4 results back on this page - hidden link - which all appear to be very recent posts (in the last month or so) - while other posts where the nearby posts are older are bringing in no results. If you click on any of the nearby posts listed - then the original post does not appear in the nearby posts - probably as it is an older post.

The Order is By post date - ascending. If i change this to descending then i get no results on any of them. If i reduce the distance in the filter, then i get fewer results back - so it's definitely filtering by distance.

So from this - there appears to be some sort of issue with the sorting that's limiting what i can see on the front end by only displaying posts published recently.

Is there a 'distance from post' parameter that we can sort on instead?

#909665

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Actually - the current release of maps do not support Sort by distance feature but its the feature we already implemented and set to release with next Toolset maps version 1.5.

Toolset maps undergoing the QA round for now and you need not wait too long time. You can expect the Maps 1.5 release by this month end or may be sooner than that.

#910736

Hi Minesh,

That's great news and something I look forward to implementing on my sites.

However, I'm still not getting the expected nearby posts appearing, with only very recent posts being displayed as mentioned above... Any insight on this would be welcome.

Thanks.

#911099

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I need to check on your install whats going wrong that and have you setup the distance filter correctly.

Could you please send me problem URL and access details and what is your expected output.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#911812

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Also - when the new google maps API conditions come in this week, we're not registering with them immediately as we've calculated that the costs will literally wipe us out. If you are unable to do it before then - we will have to put this on hold.
==> Well - can I continue to check this as I think today is the date from when google will start calculating the number of requests. Let me know please.

#912092

Hi MInesh,

Yes - its fine for you to have a look when you're ready.

I think the google maps API will still work after 11th June even without the credit cards according to some sources, with it showing a warning after the 'free' usage is exhausted, so we'll wait and see.

Either way - the nearby functionality should still work i'd imagine?

Thanks.

#912978

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - we just published a new Layouts plugin version - could you please update it.

Additionally - in order to minimize the cause of the issue and make sure there is no plugin or theme have conflict with the view:
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?

I need your site copy in order to replicate the map issues. Could you please send me duplicator copy of your site.
=> https://toolset.com/faq/provide-supporters-copy-site/

#912989

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

However - I can confirm I see the issue what you said that when changing the post date to May 2018 - it start to appear in nearby list. This is really strange. As I said to make sure that order by clause is not hijack by other options:

Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?

#913211
Screenshot (11).jpg

Just to add to this - I had to roll back my layouts version to v2.2 - as my layout disappeared in 2.3.1... Even with WPBakery Page Builder disabled.... Rolling back to 2.2, they reappeared immediately.. I think the backup you've been sent has the v.2.3.1 version. I've added a screnshot below of what this post - hidden link

should look like, but all that information dissappears on updating to 2.3.1

#913413

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - regarding the Layouts issue - could you please kindly open a separate ticket. This will help other users searching on the forum.

Now, back to the original map issue - I see with the google drive link you shared is contains only 25MB od data. What if you remove the tmp and images folders and send me duplicator copy of your site.

OR

wp-content folder without images and temp directories will be enough and database SQL zip.

I have set the next reply to private which means only you and I have access to it.

#913883

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - am I missing anything here?

When I check wp-content folder zip - it says 116MB only - and ohh, I will never able to download 10GB even I will run the download whole month.

Cold you please confirm the wp-content folder size? as I can only see 116MB at this end on google drive link you shared. I think we need to find a good way so that you can share database SQL zip and wp-content zip.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.