I have created a view of posts grouped by category using this tutorial:
https://toolset.com/2015/07/how-to-group-posts-by-category/
So I have
Category 1
-Post 1
-Post 2
-Post 3
Category 2
-Post 1
-Post 2
-Post 3
Category 3
-Post 1
-Post 2
-Post 3
However, now I would like to include the ability for the user to search by categories and thus limit the posts displayed to those matching the category or categories the user has chosen. I have tried to add a search to either the parent or child view without success. Creating a search view does not work for the child view because when you create that view there is no option to filter by taxonomy of parent. Creating a parent view with a search option resulted in a list of posts by category but the search function did not do anything.
Is there a way to accomplish my goal so that I can group posts by category and then allow the user to refine that list to show, for example just Category 1?
Hello,
The taxonomy view does not support search form, so you in your case, you can only setup the custom search form in the child post view.
In your case, it needs custom codes, for example:
1) In the child view, setup the taxonomy filter on parent taxonomy view.
2) In the child view, setup a custom search form with taxonomy filter field, when user submit the form, use filter hook wpv_filter_query to trigger a custom PHP function, and apply the taxonomy filter value to the Views query.
More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query