Sort by location not working – Fatal Error
Tagged: geotagging
-
wpsolrKeymaster3 years, 5 months ago #33008
Usually, the search url is not open from a hyperlink, but from an outside search form (home page, or top header).
If you use option “Attach the geo localization js to your own search form(s)” to include those search forms too, the form will add the lat,long parameters to the search url automatically.
prakashreddy.imduriParticipant3 years, 5 months ago #33016Okay, I got it, actually in our scenario, we have search url linked to a menu item, so we are having this issue..
And I dont want to show the location sort in widget, Any option to hide in frontend ?prakashreddy.imduriParticipant3 years, 5 months ago #33058I was checking if this can be done by a hook? or php code
wpsolrKeymaster3 years, 5 months ago #33061You can use this hook:
use wpsolr\core\classes\WPSOLR_Events; add_filter( WPSOLR_Events::WPSOLR_FILTER_SORT_FIELDS, 'wpsolr_filter_sort_fields', 10, 1 ); public function wpsolr_filter_sort_fields($default_sort_fields) { return $default_sort_fields; // array of field names }prakashreddy.imduriParticipant3 years, 5 months ago #33062Okay, unsetting will not break the functionality of still using it as a filter with direct url I guess …
You must be logged in to reply to this topic.