Home › Forums › General Issues › custom search fields
Hello,
For my site, I need to be able to perform searches on certains posts whose custom fields values are “x” or “y”. I’m not sure if I’m clear…
Let’s say I have some posts about holidays, and I have a custom field called “activity”, and another CF called “Location”.
Then I want to have a search form containing a place to put keywords, and also a field called “Location”, with checkboxes, and another field called “Activity”, with checkboxes.
For example the user types a keyword and checkcs “bicycle” and “tennis” in activity, and checks “south of France” in the location: then he’ll see a list of all the posts containing the keyword he searched, and with custom field activity being either bike or tennis, and with custom field location being “south of France”.
Do you see what I mean?
Is it possible to do it with your plugin?
Thanks

You need to look at either using one of the available search tools or building your own. The process of building such a search is far too complex to go into on this forum. Try searching for “Parametric Search” or “Faceted Search”

There are several search tools, mostly premium plugins, that offer support for ACF fields. One of them is https://facetwp.com/.
If you want to build something yourself then you should start with the Dynamic $_GET parameters section of this page https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
The topic ‘custom search fields’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.