Skip Navigation

[Resolved] My Search Filter is not Filtering the Cities in each State correctly

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

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 3 replies, has 2 voices.

Last updated by Minesh 2 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2497787

Tell us what you are trying to do?

On the page hidden link if we select the State in the drop-down selection box, I want the Cities with that State to only show.

At this time all the Cities are appearing.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

#2498199

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

It seems you are using custom field for state and city filters.

The only way to setup the dependent filters for State and City is using the post relationship where you can add the State and City as post type and create one(State) to many (City) post relationship between State and City post types and add your state and city items.

And then add the State and City as post relationship filter.

More info:
- https://toolset.com/course-lesson/creating-a-custom-search/#how-to-search-by-post-relationships

#2500995

I am so sorry its taking this long to reach back out, so what I need to do is redo the State and City customs fields. Could I filter them based on a selection from State?

#2501247

Minesh
Supporter

Languages: English (English )

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

No - as said with custom fields there is no such dependent drop down feature available.

You will have to setup States and Cities as custom post type and create one (state) to many (city) post relationship between the States and Cities post type and then add it as frontend filter.

More info:
- https://toolset.com/course-lesson/creating-a-custom-search/#how-to-search-by-post-relationships