Forums › Forums › Search & Filter Pro › Results displaying on index.php instead of search.php after first submission
Tagged: Search term
- This topic has 6 replies, 2 voices, and was last updated 6 years, 5 months ago by
Trevor.
-
Anonymous(Private) March 28, 2019 at 3:52 pm #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.
Anonymous(Private) March 28, 2019 at 6:21 pm #206854That 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.
Anonymous(Private) April 10, 2019 at 8:32 pm #208110I 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. -
AuthorPosts