Hi,
I am building a large website as an online library. I have a custom type post called Books.
Say I have 2 categories:
- History (with 2 subcategories: Egypt, Greece)
- Arts (with 2 subcategories: Sculpture and Painting)
then I have 4 books:
1- Sculpture in Ancient Egypt (needs categories: Egypt and Sculpture)
2- History of Egypt (needs category: Egypt only)
3- Painting in Modern Greece (needs categories: Greece and Painting)
4- History of Greece (needs category: Greece only)
I am trying to create a custom search for each of the main categories (History and Arts), that Display a dropdown list of the subcategories.
So when the visitor enters the page that I will create for the history section, they can see the history books (1, 2 &4), and a custom search view with a dropdown list that shows the history subcategories,
so when a visitors chooses "Egypt" from the dropdown list, they see books 1 and 2, while if they chose "Greece" they see book 4 only.
The problem is that If I chose the category "History" from the filters, is disappears from the query filters, and gets greyed out in the "Filter Editor" section.
the workaround I thought of is to create a custom taxonomy and call it "Main Categories" and add to it "History, Arts", and create the custom search view using the "main categories" and the "categories" becomes the search parameter.
it worked partially, however, because some books have the 2 main categories (books 1 and 3), the resultant dropdown contains both trees, which does not make the page a "history section".
please check the dropdown list here:
hidden link
Another workaround I thought of is creating a custom taxonomy for each main category, but this will result in around 15 taxonomy boxes for me, which is a big load on the backend.
So my question is whether there is a way to achieve what I want. if not, is there an alternative way?
please note that this is a very basic example. my real website will contain more than 500 subcategory in aroung 15 fields, and growing, so i can't manually keep adding categories, otherwise i will keep editing the views forever.
Thanks in advance.