Forum Replies Created
-
AuthorPosts
-
June 11, 2021 at 3:49 pm in reply to: re-use query sort order as search order with Ajax Search Pro. #33621
sensafred31
ParticipantGotcha!
Thanks, it works perfectly!
BR
FredrikJune 11, 2021 at 1:38 pm in reply to: re-use query sort order as search order with Ajax Search Pro. #33617sensafred31
ParticipantFound it by reading your code:
$args[‘post_primary_order_metatype’] = ‘numeric’;
🙂
/Fredrik
June 11, 2021 at 11:36 am in reply to: re-use query sort order as search order with Ajax Search Pro. #33615sensafred31
ParticipantI am working on this now. One piece of information that is missing from the documentation:
https://knowledgebase.ajaxsearchpro.com/hooks/filters/query-and-output/asp_query_args#primary-and-secondary-orderingYou can set the primary search order to
Primary ordering: Custom Field descending
custom field name: views
type: numerichow would you use that in
$args[‘post_primary_order’] = “relevance DESC”;?
June 10, 2021 at 9:31 am in reply to: re-use query sort order as search order with Ajax Search Pro. #33595sensafred31
ParticipantThanks,
what I more or less expected 🙂Anyway, a poor example. I modify the query sort order with a meta-query sort on my custom field views. And I take that from the URL, to make it identical to the URLs for date and alphabetical sort order.
https://sensative.com/use_case_market/smart-building/?orderby=date&order=desc
https://sensative.com/use_case_market/smart-building/?orderby=title&order=asc
https://sensative.com/use_case_market/smart-building/?orderby=views&order=descWordpress is kind enough to manage the re-sort based on the URL and my hack implements the views to function identically as the standard WordPress.
So, if I can make ASP respect the WordPress query on these search results and archive pages I am all done 🙂
Thanks, I’ll continue hacking based on your directions 🙂BR
Fredriksensafred31
ParticipantOk, as I guessed.
Then I’d like to put it in my wishlist 🙂
Thanks
-
AuthorPosts