Wrong search results with free search input field

Forums › Forums › Search & Filter Pro › Wrong search results with free search input field

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #29793

    Hi,

    When I type a searchphrase in the search input field, it always returns empty because it adds the post_type of the current page to the searhcquery. But not the selected post_type from the settings. For example the page where I put the filter is of post_type “tax_type” but I want the search to return only “product_type”. It is correct with the post_meta selectboxes though

    How can I prevent that it adds the post_type from the current page to the searchquery?

    Thanks
    Harry

    Ross Moderator
    #29795

    Hi Harry

    Do you have a link? It should not be adding the post type to the search – do you see the post type being added to the URL?

    Thanks

    Anonymous
    #29796
    This reply has been marked as private.
    Ross Moderator
    #29797

    Hey Harry

    If the post type is being added, rest assured its not Search & Filter that adding it.

    I think you have a plugin, or some custom code, that detects when a search is performed, and changes the post type.

    Something like a greedy pre_get_posts filter.

    This is then also having an effect on the S&F results.

    Try disabling your other plugins, and removing any custom code you have in your site to test the theory.

    Thanks

    Anonymous
    #29804

    Hi Ross,

    You hit the nail right on the head, it was indeed “pre_get_posts” in my theme who prevented correct results. I was already 2 days looking into the code, but thank it now works as expected

    Thanks

Viewing 5 posts – 1 through 5 (of 5 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.