- February 23, 2017 at 10:17 am #12080
i bought your very good plugin for WordPress.
By setting up Search Settings -> Categories&Taxonomy Terms with the maincategory e.g. “products” nothing is found. This maincategory “products” is only a Category to hold all the childcategories together. The category is not assigned to all the writen articles – only the 140 childcategories are assigned to the articles.
So here is the question:
Is it not possible to search recusiv in a maincategory? and if not, what can we do to change it.
Thank you for answer.
gabriel wagnerFebruary 23, 2017 at 2:59 pm #12090
If I understand you have a category hierarchy, where the top categories are not associated with the post type objects, only the child categories. In this case, the search indeed won’t be able to find anything, as nothing is associated with them.
However, there might be a solution. I made a small code snippet to get child terms if a parent element is found before the search. Try putting this into the functions.php file in your active theme directory:
If you use a different taxonomy as category, make sure to replace it $taxonomy variable value on line 6. Please mind, that this may not work at all, but still worth a try 🙂Best,
If you like my products, don't forget to rate them on codecanyon :)
You must be logged in to reply to this topic.