Use shortcode and display results on different pages

Forums › Forums › Search & Filter Pro › Use shortcode and display results on different pages

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #275141

    We would like to use a one form and results shortcode, and embed it to multiple different pages. In addition to that, we need the search results display below the form where the search form is added using ajax.

    Currently, when we submit the form, it redirects to a different page but what we need is just to load the results to the same page where the form is added.

    Trevor
    #275178

    You could do that by having a dynamic results URL, using this filter:

    https://searchandfilter.com/documentation/action-filter-reference/#modify-urls

    and get_peramlink() you can get 1 filter to work across multiple pages.

    I do not have any code snippets that do that, unfortunately.

    Anonymous
    #276745

    In case someone else runs into this problem, this works to add the form to multiple pages:

    function my_set_sf_resultsURL( $url, $sfid) {
    $url = get_permalink();
    return $url;

    }
    add_filter( ‘sf_results_url’, ‘my_set_sf_resultsURL’, 10, 2 );

    Ross Moderator
    #276747

    Thanks for sharing Stefan 🙏

    Anonymous
    #288372

    Yes, brilliant thank you.

Viewing 5 posts – 1 through 5 (of 5 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.