Forums › Forums › Search & Filter Pro › Create custom search fields for custom sort order
Tagged: custom sort order
- This topic has 3 replies, 2 voices, and was last updated 8 years, 2 months ago by
Trevor.
-
Anonymous(Private) January 11, 2018 at 11:29 am #151870
Hi,
I use S&F Pro in combination with Relevanssi.For very special search features I want to create two new search fields.
One for setting a location, helping to find local results,
and one for setting personal preferences .I can code the logic of the two new search fields myself.
What is the best way for creating these fields and filling them with options?
String values are enough, the additional logic comes in later.
I want to show these options similar to the other search fields in my search form.What is the best way for passing these options to relevanssi? Relevanssi plugins will do the additional sorting.
Many thanks in advance,
ElisabethTrevor(Private) January 11, 2018 at 12:42 pm #151912To create the fields I would use the free Advanced Custom Fields plugin. Then, you add values in the posts. In the Search & Filter form, you would then add a Post Meta element to the Form UI, and select the Meta Key. With ACF, note that it makes 3 meta keys per field, like this:
#1
_location
#2field_5a16902ae5c07
#3locationYou need to use key #3, without the underscore at the start of the key name.
Anonymous(Private) January 11, 2018 at 1:38 pm #151929Hi Trevor!
Many thanks for your fast reply.This quick and easy solution is however not enough for me.
With location for example, I want to show the products closest to the user location. Simply selecting a value of ACF cannot do this logic, because the user would have to check several ACF values himself.
Is it possible to expand the current plugin?
This takes time, but if the quote is reasonable I am happy to pay for that.Best wishes,
Elisabeth -
AuthorPosts