Skip Navigation

[Resolved] Hide the default filter radius and distance radius unit

This thread is resolved. Here is a description of the problem and solution.

Problem

I want to hide the default filter radius and distance radius units so it can't be changed, on a Front End Filter by Distance.

Solution

It's not possible out of the box.

The Distance filter comes as a whole set of controls.

To hide the single KM/MI selector you have to apply Custom CSS.

You can hide the input

#toolset-maps-distance-value

(ID attribute of Input addressed)
and select

#toolset-maps-distance

(select with ID toolset-maps-distance).

To edit the strings "Show results within %%DISTANCE%% of %%CENTER%%" you can do so on the GUI when you edit this Filter.

You can as well remove that text, which can suit the needs in this case.

This support ticket is created 6 years, 1 month 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.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by Edward Barker 6 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#623838

I'm trying to develop a front page search where it uses the default value of a five mile radius from any given location and I want to hide the default filter radius and distance radius unit so it can't be changed and is clean to look at.

I know there's not a default setting that can be amended but is there a workaround?

Cheers

#623941

It's not possible out of the box.

The Distance filter comes as a whole set of controls, and there is no way to remove them with the GUI.
You can only modify them because we need them for the search and the purpose of the search is, that the user also can use it on the Front End.

Now, to hide the single KM/MI selector you have to apply Custom CSS.

You can hide the input #toolset-maps-distance-value (ID attribute of Input addressed) and select #toolset-maps-distance (select with ID toolset-maps-distance).
To edit the strings "Show results within %%DISTANCE%% of %%CENTER%%" you can do so on the GUI when you edit this Filter.
You can as well remove that text, which can suit your needs.

I suggest becoming familiar with the Browser Console if you are not already.
There you will see exactly what CSS to apply where.

#624019

Brilliant stuff, funnily enough I was super close to resolving it myself but there was another conflict that I didn't notice.

For the record and if anyone else has the same issue the CSS I used to resolve the issue is as follows .......

#toolset-maps-distance-value {
display: none;
}

#toolset-maps-distance {
display: none;
}

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