Forums Forums Search & Filter Pro Using Regular Search and display results

Viewing 10 posts - 1 through 10 (of 16 total)
  • Anonymous
    #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
    #79605

    I 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
    #79607

    Hey 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″]? )

    Trevor
    #79609

    Should work, as long as the result page search form has a search field in it to ‘receive’ the search terms into.

    Anonymous
    #79613

    thanks,
    How would I set that up on the backend?
    I created a new search [searchandfilter id=”713″] but when i try to change the results shortcode to ’87’ it just changes back.

    How do i tell it to display the other results?

    Trevor
    #79616

    You do not change the results shortcode for the new form. You simply never use the results shortcode for the new form.

    Anonymous
    #79618

    Thanks 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>

    Trevor
    #79620

    Before we had this discussion, was the S&F search working? With the bigger form I mean?

    Anonymous
    #79622
    This reply has been marked as private.
    Trevor
    #79628

    What Display Results Method is it using? Please note it is getting late here where I am, and I am about to get some dinner.

Viewing 10 posts - 1 through 10 (of 16 total)