Custom Post Type/Taxonomy Results

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 jillmaturino 6 years, 2 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #16789
    jillmaturino
    jillmaturino
    Participant

    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

    #16791
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #16793
    jillmaturino
    jillmaturino
    Participant

    Thank 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.

    #16794
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.png

    Is this not correct?

    Best,
    Ernest Marcinko

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


    #16795
    jillmaturino
    jillmaturino
    Participant

    I 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.

    #16796
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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.
    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.

    Best,
    Ernest Marcinko

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


    #16801
    jillmaturino
    jillmaturino
    Participant

    I 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.

    #16805
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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
    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.

    Best,
    Ernest Marcinko

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


    #16806
    jillmaturino
    jillmaturino
    Participant

    Thank you! I think that works perfect now. I love your plugin!

    #16807
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


    #16808
    jillmaturino
    jillmaturino
    Participant

    Yes, please close. I left a review. Have a nice evening.

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

The topic ‘Custom Post Type/Taxonomy Results’ is closed to new replies.