Skip Navigation

[Resolved] Front End Custom Search by taxonomy

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

Problem:
How can I create a Custom Search in the front end for my taxonomy which I added to my posts?

Solution:
You can simply insert this using the GUI "New Filter" in the Custom Filter section of your View.
https://toolset.com/wp-content/uploads/2017/09/572821-Bildschirmfoto_2017_09_23_um_10.39.22.png?x56682

This support ticket is created 7 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 4 replies, has 2 voices.

Last updated by michaelM-30 7 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#572782

Tell us what you are trying to do?
I am trying to display my custom taxonomy of "persons names" as a dropdown list in order to sort.
Is it really that hard to do something like this?
I searched the forum and documentation - but it doesn't look that easy.

Can you give me a sample code to input into the view module?
The user guide uses only custom made dropdowns - but not taxonomies.
Or am I totally wrong?

Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/front-page-filters/

Is there a similar example that we can see?

What is the link to your site?

#572821
Bildschirmfoto 2017-09-23 um 10.39.22.png

If you want a front end custom search in a View, by a Taxonomy, as a Select Field (dropdown), then you can simply insert this using the GUI "New Filter" in the Custom Filter section.
I added a screenshot of the settings to choose.

Is that what you were looking for?

#572903

Great, I did do it wrong - I knew It would be simpler than thought.

As I have a hierarchical taxonomy - is it possible to use only the parent entries - and in a different filter the acomplishing child entries?

many thanks
Michael

#573560

No, this is not possible.

But there is a Feature Request filed to make it possible, but I can not give any ETA on this feature.

I added your voice there, so to give more weight to the request.

You can achieve a similar result by nesting a few Views, but this will not be a Custom Search as you know it.

What you could do is:
1. Create a Taxonomy View for your Taxonomy you want to query
Add a Query Filter as "Select taxonomy terms whose parent is None."
2. Create a second Taxonomy View, choose the same taxonomy, and add a Query Filter like "Select taxonomy terms whose parent is the value set by the parent view.".
Insert this View into the Loop of the first created View.
3. Create a third view, Query the post type where the taxonomy is added to.
Add a Custom Filter as "Toolset Taxonomies set by the parent Taxonomy View".
Insert this View into the loop of the second created View (step 2 above).
4. Insert the first View to any Page.
What you see now, is a list of parent Terms, with their nested Child Terms, and their attached Posts.

This solution is not nice and clean like a Custom Search, and it allows no dynamic filtering, I am aware of this.

In order to make this better, the feature request is filed.

#574017

thanks