Reply To: Recursiv Search in Frontend Search Settings

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Recursiv Search in Frontend Search Settings Reply To: Recursiv Search in Frontend Search Settings

#12090

Ernest Marcinko
Keymaster

Hi Gabriel,

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,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)