Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom Post Type/Taxonomy Results
This topic contains 10 replies, has 2 voices, and was last updated by jillmaturino 6 years, 2 months ago.
- AuthorPosts
- February 14, 2018 at 10:34 pm #16789
I have the search on https://hbfls.wpengine.com/faq-search. I am trying to get the search box to search through the custom post type ‘FAQs’ (not faq) and through the taxonomies ‘FAQ Topics’. I have the search box showing this correctly, however, when I click onto one of the topics, it tries to load a page: https://hbfls.wpengine.com/blog/faq-topics/arrest/ . This is just showing all blog posts. Even if I change the URL in the browser to https://hbfls.wpengine.com/faqs/faq-topics/arrest/, it doesn’t work and shows me a 404. Please advise. Thanks
February 15, 2018 at 10:11 am #16791Hi,
The search returns that link, because that is the correct link provided by WordPress to the faq topics. If you check the faq topics taxonomy page on the back-end, and click on the view button, it will redirect you to that page as well: https://i.imgur.com/g1H6lC1.png
This means, that the permalink structure is likely not configured correctly, as WordPress itself thinks this is the correct URL. Make sure to check your permalink configuration under the Settings -> Permalinks submenu. On the bottom of the page there is usually an option for custom taxonomy terms to fix their permalinks: https://i.imgur.com/3W6CHX0.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 15, 2018 at 4:02 pm #16793Thank you. That did the trick. However, when I use the taxonomy filter on the right of the search box and select a taxonomy at the bottom, the search box doesn’t reflect the change.
February 15, 2018 at 4:48 pm #16794Hi,
You are welcome!
I just tested, but it seems to be working on my end. For example if I type in appellate with all boxes checked, I get these results: https://i.imgur.com/dMwtVtv.png
When I uncheck the ‘appellate’ category, results that are assigned to that category get excluded: https://i.imgur.com/EAgNu4S.pngIs this not correct?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 15, 2018 at 5:10 pm #16795I expected it to work differently. If I check the box for workers compensation, I would expect that I could view all posts under that taxonomy, or at least it would show the workers compensation taxonomy in the search results drop down box that I could then click on and view all posts in that taxonomy.
February 15, 2018 at 5:24 pm #16796Hi!
Filtering a taxonomy term results by taxonomy term filter is not possible, because there is no assignment between them, like with posts. Posts can have categories assigned, but categories can’t have other categories assigned, thus can’t be filtered.
There might be a way to exclude the unchecked categories from showing in the result though, using a custom filter code. Do you want me to look into it? If I find a solution, can I add it to the functions.php file in your active theme directory via the FTP details? (that is the best possible location for a custom code)I believe the reason why you don’t see any results when you only check Workers Compensation is, because those results are also within the Personal injury law category – which is unchecked, thus it tells the search to exclude anything that is within that category.
Best,
There is a very simple resolution to this, on the Frontend search settings -> Advanced panel, change this option: https://i.imgur.com/LL3SIWd.png
With this term logic, any post that matches at least one of the chosen categories will show up.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 15, 2018 at 8:36 pm #16801I have checked the option that you suggest and workers compensation still does not show up in the search results list. The categories seem to stop after custody in alpha sorting.
And, yes, I would love for you to see if you could find a filter to add to the functions file to exclude the unchecked categories from showing in the result.
February 15, 2018 at 10:07 pm #16805Hi,
I have added a small custom code snippet to the functions.php in your child theme directory viat SFTP. The unchecked taxonomy terms are now excluded from the search.
The cut-off is simply because the search reaches the results limit (10 items by default). You can change those limits under the General Options -> Limits panel: https://i.imgur.com/2HoNBQk.png
Best,
For optimal performance I usually recommend keeping those limits under 150, but I think in your case even a bit lower number will do the trick.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 15, 2018 at 10:13 pm #16806Thank you! I think that works perfect now. I love your plugin!
February 15, 2018 at 10:14 pm #16807You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 15, 2018 at 10:16 pm #16808Yes, please close. I left a review. Have a nice evening.
- AuthorPosts
The topic ‘Custom Post Type/Taxonomy Results’ is closed to new replies.