Skip Navigation

[Resolved] Parametric search based on taxonomy hierarchy

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

Problem:

The issue here is that the user had a hierarchy taxonomy and wanted to have separate filters for the Parent and Child Terms.

Solution:

Unfortunately this is not possible to do since its still only one taxonomy. In order to have separate filters you will need to create it as separate taxonomies.

This support ticket is created 6 years, 8 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 3.26 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Shane 6 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#629784

Hi!
I need help to create a page which displays custom post types results with 3 front-end filters (select type).
I have a view with all custom post type "House" entries in a grid loop. "House" has "Places" as taxonomy. "Places" has this hierarchy:

State 1 (Parent)
- Area 1 (1st child)
-- City 1 (2nd child)
State 2 (Parent)
- Area 2 (1st child)
-- City 2 (2nd child)
...

I want to add the 3 filters to let the user search in 3 steps:
1 - Select the State
2 - Select the Area
3 - Select the City

Each step should update the grid loop.

Is it possible?

#629825

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Antonio,

Thank you for contacting our support forum.

Unfortunately no this is not possible as these elements will need to completely separate taxnomies in order for you to achieve this setup.

Since the filter is just one taxonomy it is going to retrieve all the terms for that taxonomy.

Thanks,
Shane

#629831

Hi Shane!
Thanks for the quick reply.

What if I put that values also in 3 new post custom fields? Would it work?

#629848

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Antonio,

Yes that should work given that you have separated them.

Thanks,
Shane

#630271

Is there a tutorial I can use for this?

#631142

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Antonio,

A tutorial on how to separate them ? Or are you referring to a tutorial on how to create the custom fields.

I'm not 100% sure exactly what you mean so please provide a little more detail so that I can best advise on this one.

Thanks,
Shane

#631148

Hi Shane,
my fault. I need a tutorial to separate them. Is there a php function to pick the values from terms (parent, child and grand-child) and fill the custom post fields?

#631163

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Antonio,

Thank you for the clarity.

Unfortunately no there isn't

This will all need to be done manually.

Thanks,
Shane