Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Creating a general search bar with specific filter by categories
This topic contains 8 replies, has 2 voices, and was last updated by Ernest Marcinko 5 months, 4 weeks ago.
- AuthorPosts
- September 6, 2022 at 6:38 pm #39220
Hi! I created a general search bar so It can search everything in the website. I was trying to use the Filter by category (added all the site’s categories) and also added the Advanced Options > exclude/include > Include all the categories from the filter by category
When searching for a specific category, it appears at least 7-8 posts that don’t belong to the category first and then after scrolling down the posts pertinent to that category
How to check the category and display only the posts pertinent to that specific category?
https://ibb.co/f1dbyyD
https://ibb.co/n7F2zgJ
https://ibb.co/BVqQ9PJSeptember 7, 2022 at 9:56 am #39230Hi,
Try turning OFF this option: https://i.imgur.com/eksNvUO.png
Best,
That will prevent displaying items, which have no assigned elements from the given taxonomy.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 7, 2022 at 12:58 pm #39235it was off
September 9, 2022 at 7:05 pm #39237Any update here?
September 10, 2022 at 11:32 am #39238I’m so sorry, I actually answered, but something happened to my browser and it did not send the message.
Can you please remove the post type inclusions: https://ibb.co/BVqQ9PJ
That will mix up with the filter, and include items from those categories as well.If you don’t get any results afterwards, then also try changing the checkbox logic like so: https://i.imgur.com/zsx2oT9.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 12, 2022 at 2:46 pm #39242Hi! No problem!
I did that and the search bar is in a loop of infinite search and loading….
It works after loading for some time… I will check my server resources and see if that’s affecting the search bar!
Can you clarify what is the advantage of using the Include posts by taxonomy? It should only be used for a specific category right? not for the whole site?! I’m so confused lol
September 13, 2022 at 2:59 pm #39250May I take a look at this somewhere?
Using the inclusion option is to restrict the results to those categories only. However if you are using the search filters, that will already do the same thing – restrict to the selected categories. To get the best performance, I only recommend using one or the other.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 23, 2022 at 3:56 pm #39431You cannot access this content.September 25, 2022 at 8:51 pm #39474That looks as if the search process is stuck somewhere.
Do you use post exclusions or inclusions by taxonomies? If so, are there many categories excluded/included?
Can you try removing the exclusions, to see if that makes any difference.I also recommend to check this documentation for performance optimization tricks. I highly recommend using the index table engine.
Best,
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.