This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Not change default query, switch betwenn querys not working

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Not change default query, switch betwenn querys not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37036
    derpderp
    Participant

    I make a search with metakey ordering. But when load the page the triggered result list is not in this order. This is in the default query order. I try to change $query before the plugin, but it not working.
    After the first filter or search the result is in correct order to page refreshing.
    Int he page I use the vertical result layout, this show only the results.
    I try more options, now set to autopopulate with latest results, and using cookies. But always loading the default WP ordering.
    And the second problem, I want to try change ordering in the same ASP Query, but it not working. (php – add_filter(“asp_query_args”, “asp_query_args_change”, 10, 2); and after apply_filters(‘asp_query_indextable’, $query, $args, $search_id, $is_ajax); ). This not working. After I try with url attributes, but it isn’t working too.

    #37089
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Changing the WP_Query order is not going to do anything, since the plugin uses it’s own ordering, which you can set under the General Options -> Ordering panel here: https://i.imgur.com/qlxy8So.png
    When using the auto-populate with the latest results, then the ordering will be forced as date descending of course. If you want to have the default order (as set on the ordering panel), then use the auto-populate for an empty phrase instead: https://i.imgur.com/O7uUDit.png

    The programmatical query arguments ordering change was probably not working for the same reason for the auto populate. The ordering parameter is the $args['post_primary_order'] and the $args['post_secondary_order'] variables.

    #37129
    derpderp
    Participant

    You cannot access this content.

    #37136
    derpderp
    Participant

    You cannot access this content.

    #37146
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Janos Torba,

    That is, because that input is not the right one. That one is used for visual purposes only. The actual value is taken from the hidden input just below the visual input: https://i.imgur.com/H2PdowG.png

    Something like this will do it:

    jQuery('input[name=post_date_from]').val('2022-03-01')

    The search will always take the parameters into account, the form values from the settings is always sent as a serialized array to the back-end.

    #37185
    derpderp
    Participant

    Hi Ernest Marcinko,

    Thank you very much your answer. This is solve our problem.

    Thanks,
    Péter Dér and János Torba

    #37186
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #37187
    derpderp
    Participant

    Yes, you can close this topic.
    I rate your plugin now, because I think is the best search and more costumizable plugin.

    Péter Dér

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Not change default query, switch betwenn querys not working’ is closed to new replies.