Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › User search
This topic contains 4 replies, has 2 voices, and was last updated by aannolfi 5 years, 7 months ago.
- AuthorPosts
- January 24, 2019 at 7:36 pm #20971
Hello, I am trying to create a user search form. I read almost all the available documentation but I didn’t manage to solve my problem.
I have buddypress installed, I have custom wordpress/buddyoress (wp/bp)) user field (city, province, description, activity, etc…). I need to create a search form allowing the generic website visitor to search for user by means of dropdown selector (one for each custom field). is it possible? I managed to create a search box where visitors can type city name and getting the list of wp/bp user living in a specific city (if I search using more words such as tyiping city and province, I don’t get any result)January 25, 2019 at 10:30 am #20977Hi,
In this case I’m afraid the drop-down selector is not possible, because buddyPress xprofile fields are not user meta fields (custom fields), so those cannot be used as filter criteria.
Best,
I have cleaned up a bit the buddypress xprofile section, so that only the fields are selected, as for some reason the values were there as well.
You can also enable the secondary logic, if you want to – so that you might get better results when multiple keywords are entered from different fields.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 28, 2019 at 10:11 am #20991Many thanks for you reply.
I am trying to use secondary logic but I have problem.Say we have to user located in city of Apricena (Emanuele Libero and Antonio Francesco Parisi) and only one is a DJ (Emanuele Libero)
If I type “apricena” in search box I should have two results (Emanuele Libero and Antonio Francesco Parisi) – and this is fine. it works
If I type “apricena dj” I should have one result (Emanuele Libero). Here I have problem. I didn’t manage to make it works. I get no result
I enabled secondary logic “AND” with no resultwould this plugin “https://wordpress.org/plugins/advanced-custom-fields/” help in order to add user meta fields?
Alessio
January 28, 2019 at 11:13 am #20998Hi Alessio,
I believe you might need the ‘OR’ secondary logic instead. I am not sure if that will return only the one result, as the xProfile fields are all separate fields, and the keyword logic applies on each field separately.
I think ACF has a feature to add user meta fields, I think that should work. You should maybe try creating 1 or 2 fields for testing, but as far as I know, ACF uses regular user meta, so that should be okay.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 28, 2019 at 4:55 pm #21003Hi Ernest, the OR secondary logic returns 2 results. I check ACF and I’ll let you know.
Many thanks,
Alessio - AuthorPosts
You must be logged in to reply to this topic.