Forums Forums Search & Filter Pro Results initially added via AJAX

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #195845

    Hi there,

    I have a page that uses a button to to asynchronously bring in the wp_query results set that I would like Search and filter to filter on. I need to pass the filter query to this ajax function. Currently as the results are initially given via AJAX the S&FPro does not work at all obviously.

    Any help would be appreciated.

    Thanks,
    Dan

    Trevor
    #195856
    This reply has been marked as private.
    Anonymous
    #195858

    I will try and explain more clearly. I appreciate you getting back to me.

    On page load I do not wish any posts to be displayed.

    I would like the user to read a message. Then hit ‘start’ – the start button is an AJAX call to my wp_query that then returns all the posts.

    It is these posts that are returned via the AJAX that I would like to then filter using S&FPro.

    Hope that makes sense.

    Anonymous
    #195862

    Hi there,

    If I could pass “?_sft_adaptation_outcome=io_res&_sft_broad_type_nbs=nbs_eba” to my wp_query I think I could get it to work. Is this possible?

    Trevor
    #195880

    You can use PHP to access the query, see this page:

    https://searchandfilter.com/documentation/accessing-search-data/

    Are you using php or javascript to build the query?

    Anonymous
    #195882

    Hey,

    I’m using PHP, so if this is the query:

    $sf_current_query = $searchandfilter->get(1033)->current_query();

    Once I have $sf_current_query how do I feed that into wp_query to return a specific set of results?

    Thanks,
    Dan

    Anonymous
    #195945

    Hi Trevor,

    I appreciate all your help but I’m not sure this is the route to take for my original problem. I will dig further and post anything if I find anything.

    Kind regards,
    Dan

    Trevor
    #195949

    The problem is how to connect our plugin to the code run by their [jobs] shortcode. If that used a PHP template with a wp_query function in it, then maybe. They might also have a hook/filter that allows you to add extra arguments to their query.

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