I'm trying to add functionality to a search function working around WP_Query, at the moment everything is working just as intended all I need now is to have the outputted results get order according to amount of matching meta keys of the result.

In this project visitors can select to filter their search by selecting multiple locations, each entry on the site has multiple locations linked to them, so when the visitor selects multiple locations some of the entries should have more then one meta key value that matches.

Meaning that a result that matches 3 of the entered meta values of the search will get displayed before one that only matches 2.

So basically my question is, what is the best why of approaching this or is there maybe a way to integrated it in to the WP_Query function.

Here is the link to the current site (Page) https://pemburytours.com/temp-search-page/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.