Skip Navigation

[Resolved] limit taxonomy (category) filter to only first level

This support ticket is created 5 years, 4 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
- 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)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Shane 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1346533

Wim

I am creating a category filter. Categories have subcategories but every post in a subcategory also belongs in a main category. In the dropdown filter in a custom search filter I only want to show the top level categories, so no subcategories should be visible. Is it possible somehow to limit the depth?

#1346595

Shane
Supporter

Languages: English (English )

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

Hi Wim,

Thank you for contacting our support forum.

Unfortunately no its not possible to do this.

What I would recommend that you do is to open a feature request to get such a functionality added to the filter for the taxonomy.
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Please let me know if this helps.

Thanks,
Shane

#1346665

Wim

Hi Shane,

Really not possible? That is most unfortunately. I will see if I can hide them with some jQuery but maybe this might indeed be a nice feature to add? I you might have an idea for some jQuery to hide them, I would not say no to that 😉

#1346693

Shane
Supporter

Languages: English (English )

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

Hi Wim,

There is a way to hide it but Its not practical if you have alot of options.

Take a look at the link below.
https://stackoverflow.com/questions/1271503/hide-options-in-a-select-list-using-jquery

The simple jQuery script here is able to hide the options for you.

Thanks,
Shane