Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro double result page for single form

Viewing 7 posts - 1 through 7 (of 7 total)
  • Laura Camellini
    #67696

    Hi, I’d like to show the same results listings (by the same form) in two different pages using the same template.
    Is this possible with your plugin?
    Thanks,
    LauraC

    Trevor Moderator
    #67745

    Each search form is designed to have its own results page. However, if you use the archives display method and have Ajax enabled and use Auto Submit, the results will actually appear on the origin page.

    Laura Camellini
    #67748

    On your documentation

    https://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/

    you say this is possible querying the form from another page:

    <?php
    	//grab the active query from our search form
    	//replace <code>1526</code> with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(1526)->current_query();
    ?>

    Whould this display the filtered posts to a php template?

    Trevor Moderator
    #68063

    Sorry, I do not quite understand what you are trying to achieve. That code could be used on a results page to get the actual query variable as sent by the form. Under normal circumstances, Search & Filter will use these to provide the wp_query arguments to filter the posts to make the results loop. You could use the Custom method, and to do this all you have to then do is find when the arguments for the loop are set, and immediately after them add code like this:

    $args['search_filter_id'] = 16439;
    

    As shown in this post (obviously change the ID number of the form):

    https://support.searchandfilter.com/forums/topic/help-with-search-form-creation/page/2/#post-65516

    Laura Camellini
    #68075

    So this is possible in a simple wp_query template!
    Thanks a lot!

    Trevor Moderator
    #68081

    Does this answer your question, and if so can I close the thread?

    Laura Camellini
    #68105

    yes sure, thank you again

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘double result page for single form’ is closed to new replies.