Forums Forums Search & Filter Pro Results displaying on index.php instead of search.php after first submission

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #206797

    To clarify, the search bar that comes from the site is not from S&F Pro, it’s just the WP default search bar, but it will bring the user to search.php for the results – where the S&F shortcode form resides. It’s when searching in the S&F shortcode form that the results go to index.php. Thanks.

    Trevor
    #206804

    On the Advanced tab, did you try setting force is_search?

    Anonymous
    #206854

    That did the trick! Thanks so much!

    Also – is there any reason why the search term isn’t already in the search form when landing on the search results? Looks like this is only an issue when I use my default WP search bar elsewhere on the site that takes me to the results the first time. If I add a search term in the shortcode form on the search results page – it keeps the search word in the field after submission.

    Trevor
    #206870

    You may need to perform a URL rewrite of the standard search. This post looks at one way to do this:

    https://support.searchandfilter.com/forums/topic/how-to-maintain-search-string-while-filtering/#post-205209

    Anonymous
    #208110

    I managed to pull the term in by using the sf_input_object_pre hook so find the search field and check if the value was empty. On my site, the only way to get to the search results page is from the header search so they should always arrive with a search term. So by getting the term from $wp->query_vars['s'], it will fill it into the shortcode form before it renders the first time on the results page.

    I’m still having some funky issues though – like the logo on my site is a link to the homepage on every page that is NOT the homepage. But since is_home is now true on the search results page despite that I’m forcing the is_search from the plugin options, I had to edit my logo so it would be a link if it was search with is_search. So far so good. Thank you for all your patience. Much appreciated.

    Trevor
    #208127

    Great news. Is it OK to close this thread for now?

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