Forums › Forums › Search & Filter Pro › Forward query from search box in header of theme to filter search form
Tagged: forward query, search results
- This topic has 2 replies, 2 voices, and was last updated 8 years, 5 months ago by Anonymous.
-
Anonymous(Private) May 27, 2016 at 4:11 pm #46885
Hello all,
I wish to have a search box in my header to start a query. After running the search the user should be forwarded to the search results page, with further filters in the left sidebar. The query therefor should be handed over to the form the search form in the header to the one crated with this plugin.
In my header I have a searchfield:<form method="get" class="searchform themeform" action="<?php echo home_url('/'); ?>"> <div class="header-searchfield"> <input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php _e(' Suchst du nach etwas?...','hueman'); ?>';" onfocus="if(this.value=='<?php _e(' Suchst du nach etwas?...','hueman'); ?>')this.value='';" value="<?php _e(' Suchst du nach etwas?...','hueman'); ?>" /> </div> </form>
And with Search and Filter I set up a search from based on the archive page “search.php” and I also tried a static page “Search results” with short code. Which is better to use in this case?
How do I have to adjust the code so the query typed in the header also appears in the search field of the search form search and filter?
Trevor(Private) May 27, 2016 at 7:04 pm #46899Ah, in the Header is the theme search?
The last user I had this same question (exact same question) they edited the theme header and placed a search & Filter in the header template (using the shortcode by using the WordPress do_shortcode function), and that form was using the as an archive method, to the search results page, on which there was a different and more detailed search form and the results. It worked fine.
Anonymous(Private) May 27, 2016 at 11:04 pm #46907Thanks for the quick respond. The forward with the Archive page worked in general, but not for me as I have another problem then. But I could also solve it that way, that I create another form as you said and linked that to my search results page, where the short code of my more detailed search form was insert. So the first field just opens the result page and starts directly with the results of the second.
Works perfekt. Resolved. Thanks
-
AuthorPosts