Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Category restriction
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 4 months ago.
- AuthorPosts
- July 26, 2018 at 8:43 pm #18787
Good Morning
I need help to configure the behavior of filters by category.
I need to filter the publications on my “Recipes” page, and these are identified with two main categories: By Color and By type.
The idea is that when a category is selected, only the publications identified with that category name are shown, either a By Color or By Type category, even if the publication is identified with a different category, since some publications can be categorized by color and by type at the same time.
But, I want that when you select a category color and a category by type, only those color publications that also belong to that type are displayed.
Just now when you select color it shows all the color publications, but when you select a type, it shows all the categories of the type even if other colors exist.
I explain myself well?
July 27, 2018 at 12:33 pm #18796Hi,
I think I understant exactly.
This might be very problematic (might be even impossible), because the color and type are not separete taxonomies, but within the same taxonomy ‘category’.
The only closest possible solution is to try this option: https://i.imgur.com/SSxCHSD.png
However this option will make sure that only compare the ‘checked’ checkboxes against the matches. Alll the results must match all the checked checkboxes though. So if you select more than one color and type, then it is very likely you won’t get any results.If the color and the type were in a separate taxonomy, then the current configuration would work perfectly, as there would be two separate filters, which would be compared by a separate logic. In that case if you checked any colors and any number of types, then you would get results matching at least one color AND at least one type at the same time.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 27, 2018 at 3:30 pm #18800Hi, thanks for your response
The first option you offer does not work for me because it would be very strict and would not work well for users.
On the other hand, the second option, where you talk about the separated categories seems more interesting to me. But I do not know how to separate the categories and create the necessary logic for the categories to interact with each other.
Can you share with me information about it?
July 28, 2018 at 10:15 am #18807Sure, I think this includes all the information:
Best,
– https://codex.wordpress.org/Taxonomies
– https://codex.wordpress.org/Function_Reference/register_taxonomy
– https://wordpress.org/plugins/tags/custom-taxonomies/
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.