I have a custom post type called LAW.
LAW has three custom fields: LAW_DATE, LAW_TEXT and LAW_AUTHOR.
I want to build a search page that allows me to search independently each of these custom fields.
I.e. different criteria for each field, combined with and/or to each other.
Thanks.
The following function needs to be put in the functions.php of your template code. Or in a plugin.
The above function assumes that the HTML form will be similar to this:
It makes no validation on the user input, (wordpress might do some of that but it’s better if you do it).