Forums › Forums › Search & Filter Pro › Using Regular Search and display results
Tagged: Wordpress Search
- This topic has 15 replies, 2 voices, and was last updated 8 years, 3 months ago by
Anonymous.
-
Anonymous(Private) January 2, 2017 at 7:23 pm #79586
Hi I am wondering if there is a way to use the default WordPress search to search the results and show them in the same template as the regular search results.
Basically the idea would be exactly the same as if they used the keyword search, the same results would show, but instead of them typing it in the search and filter box, they would type it in the wordpress one (currently I’m using the Divi theme by Elegant Themes).Is that possible? Are yuo able to guide me please, if they are files to change?
Thank you and have a great day!
Trevor(Private) January 2, 2017 at 8:06 pm #79605I did this/showed for someone else before. They made an S&F form with just the search field, found where in the theme template files to code was to put the normal search on the page, and replaced that with a PHP do_shortcode() to display the S&F form. I cannot remember how, but if the search box is in the header, look inside a file called header.php in your theme.
Anonymous(Private) January 2, 2017 at 8:12 pm #79607Hey thanks, that’s an interesting idea.
Would that work as well in our case? I have a form already that is pulling in the data.
I don’t think it makes sense to have two forms right?
Can I have 1 search query search another form?
(I.e. can i have the main search query [searchandfilter id=”87″] do the main search on the page and another search query e.g. [searchandfilter id=”88″] with just the search form, go to the same results as [searchandfilter id=”87″]? )
Anonymous(Private) January 2, 2017 at 8:45 pm #79618Thanks for the response, but now I’m confused.
Sorry.
If we arent using the results, then how does it know where to display them?
How does it know where to go?If I understand correctly, I should place <?php echo do_shortcode([searchandfilter id=”713″]); ?> where the wordpress search currently is. (actually do i just replace the whole thing starting from the form role=”search”, or just something inside it?) But then how does it know to display the results of the ’87’ search? How do i point it there?
This is the search currently:
<div class=”et_search_outer”>
<div class=”container et_search_form_container”>
<form role=”search” method=”get” class=”et-search-form” action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”>
<?php
printf( ‘<input type=”search” class=”et-search-field” placeholder=”%1$s” value=”%2$s” name=”s” title=”%3$s” />’,
esc_attr__( ‘Search …’, ‘Divi’ ),
get_search_query(),
esc_attr__( ‘Search for:’, ‘Divi’ )
);
?>
</form>
<span class=”et_close_search_field”></span>
</div>
</div> -
AuthorPosts