Recursiv Search in Frontend Search Settings

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

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #12080

    Hello together,
    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.

    in advance

    gabriel wagner

    Ernest Marcinko
    Ernest Marcinko

    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 🙂

    Ernest Marcinko

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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.