Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Not change default query, switch betwenn querys not working
- This topic has 7 replies, 2 voices, and was last updated 4 years, 2 months ago by
derp.
-
AuthorPosts
-
March 6, 2022 at 12:37 pm #37036
derp
ParticipantI 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.March 7, 2022 at 3:48 pm #37089Ernest Marcinko
KeymasterHi,
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.pngThe 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.March 9, 2022 at 11:45 pm #37129derp
ParticipantYou cannot access this content.
March 10, 2022 at 9:21 pm #37136derp
ParticipantYou cannot access this content.
March 11, 2022 at 4:02 pm #37146Ernest Marcinko
KeymasterHi 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.
March 15, 2022 at 4:24 pm #37185derp
ParticipantHi Ernest Marcinko,
Thank you very much your answer. This is solve our problem.
Thanks,
Péter Dér and János TorbaMarch 15, 2022 at 4:24 pm #37186Ernest Marcinko
KeymasterYou cannot access this content.
March 15, 2022 at 4:27 pm #37187derp
ParticipantYes, 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
-
AuthorPosts
- The topic ‘Not change default query, switch betwenn querys not working’ is closed to new replies.