Skip Navigation

[Resolved] Distance filter on Archive Page

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 1.17 hours from now. Thank you for your understanding.

This topic contains 5 replies, has 3 voices.

Last updated by Don 6 months ago.

Assigned support staff: Jamal.

Author
Posts
#2024617

Tell us what you are trying to do?
Include Distance filter on an Archive page. I see the last tread on this topic is 1 year and 6 months old with no clear solution to add distance filter to an archive page, so I wonder if there is this option now. If not, is there a way to override the archive page with a view block instead in order to use the distance filter?

Is there any documentation that you are following?
Yes.
https://toolset.com/forums/topic/results-archive-filter-by-location/

Is there a similar example that we can see?
N/A

What is the link to your site?
br2you.net

#2024947

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

Indeed, distance searches are not yet supported in archive templates. What, I would suggest is to use a regular page and a view inside of it as an archive. Then, disable the archive completely in the post type definition. Check this screenshot hidden link

This way you can keep having pretty URLs. If the custom post type slug is "place", create a page with the slug place and you will get:
- The page will have hidden link
- Posts will have hidden link

I hope this answers your question. Let me know if you have any further questions.

#2025441

Thanks for the quick response, Jamal! Please consider the following test scenario. I'm using a regular search tool bar from WordPress (actually powered by Relevanssi) to give more options to user find post content in my website. The problem is that the WordPress (Relevanssi) search results go automatically to a default archive page built by WordPress. In this scenario I'm still not able to avoid the default archive page. Post types results still land on this default archive page. Another example, users are automatically sent to a default WP archive if they click on a Taxonomy field e.g Category. This seems to be a built in function in WordPress. My goal is to further filter these results by using the Tools set Distance filter. Is it possible to achieve this goal? Is it even possible to avoid this archive page at all?

Thanks!

#2026041

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I think it is possible to disable the global search using custom code or a plugin, check these links:
- hidden link
- https://wordpress.org/plugins/disable-search/

Regarding the use of Relevanssi, when used inside a view, the search is basically done using Relevanssi, and the view only displays the results. Other filters, like the distance filter, can't be used with Relevanssi searches.

However, I believe it is possible to create an integration using custom code. Let me know if you want a suggestion on how to do it. Please note, that custom code is beyond the scope of this support forum. You may need to hire a developer.

Regarding taxonomy archives, they also can be disabled using custom code. Check these links:
- https://wordpress.stackexchange.com/questions/140351/how-to-completely-disable-a-taxonomy-archive-on-the-frontend
- hidden link

#2032641

My issue is resolved now. Thank you!

#2079199

Don

hello,

i wanted to follow up on this too.... i am also in need of distance filtering on archive pages...... it seems like a big workaround to fight against the default way wordpress does this, creating archives for post types, and have to do as a pseudo-archive on a new page with a "normal view" instead of the one that is specifically available for archives.... i have found a difference between the archive view and a normal one that is BETTER, for my needs, the way the archive does it (ie i am able to separate the archive search from the archive output better than in a normal one).... but i also NEED distance filtering for my archive!

Is there ANY way to use distance filtering on an archive page and if not can it PLEASE be added in sometime soon?