Forums Forums Search & Filter Pro Filter Query Args

Viewing 10 posts - 11 through 20 (of 24 total)
  • Ross Moderator
    #37301

    Hey Christopher

    I think the issue here is, get_queried_object I believe will retrieve the last queried object.

    So depends where you are calling get_queried_object, maybe you should call it somewhere much earlier in the code, save the variable, then use this variable in S&F.

    Anyway, on to the next issue.

    For me it looks like it still works with pagination?

    What happens when you stop using get_queried_object and manually set it – like: hotels-motels as per your earlier example, does the filtering work across pagination & when using hte filters?

    I’m guessing it will.

    In this case, then we are back at the issue of how get_queried_object is working.

    Thanks

    Anonymous
    #37355

    Hi Ross,
    it appears that you are correct about get_queried_object being the issue.

    Yes pagination still works.

    When I enter hotels-motels as a static value everything appears to work properly.

    How do you go about saving get_queried_object from a template and using it in the filter function for S&F? Is there a way of filtering the query_args from within the template (or would that even help?)?

    Anonymous
    #37686

    Hi Ross,
    curious if you got a chance to look into that last question.

    Thanks.

    Ross Moderator
    #37795

    Hey Christopher

    Getting the right info at the right time with get_queried_object is really not a S&F issue, but more a general WP issue.

    That being said, I do want to test this theory out so will be setting up a demo locally in the next few days and let you know the result.

    My idea is to capture the get_queried_object value say on the WP init hook, and store it in a global variable – where exactly to do this is the purpose of my testing – I don’t know the correct time to detect the current archive.

    Then later on in the execution, lets say before a S&F query (any kind) we can call up this variable rather than using the function get_queried_object to modify S&F behaviour

    Thanks

    Anonymous
    #37861

    Ross,
    I am very interested in your findings. Please keep me in the loop on this as this could make S&F far more useful.

    Anonymous
    #38386

    Hi Ross,
    have you made any progress with a local demo?

    Anonymous
    #39021

    Kind of interesting discover on this today. Using http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/ as an example. once I’ve made a selection from my dropdown (we’ll use British Columbia) and submit, the search clears the results and displays all members (nothing new), but when I select “next” in the pagination, it remembers my search criteria and reapplies hotels and motels to it.

    I also tried using single_cat_title("", false); as an alternative to get_queried_object , but that made no difference.

    Ross Moderator
    #39032

    Hey there

    Ok so I stumbled across what it may be.

    Can you disable Ajax and test again?

    Also, can you just confirm your display method is current “shortcode”?

    Thanks

    Anonymous
    #39071

    Hi Ross,
    my display method is “shortcode” . My results shortcode is added in the template like this <?php echo do_shortcode( '[searchandfilter id="3906" show="results"]' ); ?>

    I have turned off displaying results with Ajax and I now receive no my standard search.php page with no results found.

    With Ajax on and “Update the Search Form on user interaction” turned off, the search works with the category criteria as long as a term is entered in the search field. If a category is selected without a term in the search field, it shows everything in that category without filtering via the “Hotels & Motels” .

    Let me know if I need to clarify any of this.

    Thanks.

    Ross Moderator
    #39073

    Hi again Christopher

    I see, please take a look at your Results URL setting in the display results tab – it should be:

    http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/

    Which is why you get a 404:

    http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/_sft_member-region=washington

    There is no ? in the URL (which will be fixed with a valid results URL – and will become:

    http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/?_sft_member-region=washington

    Thanks

Viewing 10 posts - 11 through 20 (of 24 total)