Forums › Forums › Search & Filter Pro › Getting both Search and Filter Pro and default WP search to use same results
- This topic has 6 replies, 2 voices, and was last updated 4 years, 4 months ago by Trevor.
-
Anonymous(Private) July 6, 2020 at 2:52 pm #251511
I want my Search and Filter Pro results and my “normal” wordpress search to both use the same results page. I cannot figure out how to do this. I think I can either:
1) Magically change the default WP search to use my new Search and Filter Pro results template when someone submits on that default form. But I’m unsure how to do that…
2) make Search and Filter Pro use my default results template in WP… but again I’m unsure how to do that.
What is the best and easiest way to get these aligned you think?
Trevor(Private) July 6, 2020 at 3:00 pm #251518You need to decide where you want to send the search (either a page with a slug or not), and use a WordPress rewrite in your child theme functions.php file. Our form must have a search box in it it to ‘receive’ the search term from the theme search.
There is an example here (the site shown uses a slug name for the search results page, which looks nicer):
Here there is an example of one that doesn’t use a slug:
NOTE: If both our search form and the theme search are on the same page, and that is the results page, the two forms will not ‘talk’ to each other.
Anonymous(Private) July 6, 2020 at 3:18 pm #251536Ahhh ok I understand. So I used that PHP snippet, and now my default WP results display on my custom Page with a shortcode. And my Search and Filter Pro results also display on this same Page of results… so this all works great.
But I have a big problem it seems… no matter what search query I deliver, the results appear to always display all the posts on my site. So if I search for “Starbucks” on either the default WP form or the Search and Filter Pro form, they both return all results on my site. But I have no posts containing “Starbucks”… so why does it always return everything? And when I search for something weird like “jhbgUTuygv” it also always returns everything. i’m sure there is something small I am missing to fix this?
Anonymous(Private) July 7, 2020 at 1:04 pm #251723Ahhh, that fixed it 🙂 I actually already have a Relevanassi plugin — I bought one a year ago but it failed to work correctly and Mikko was unable to help, so i stopped using it. So I just installed it on this new site and all works well 🙂
Thank you so much for your great support!
-
AuthorPosts