Home › Forums › General Issues › Filter two fields › Reply To: Filter two fields
Hi @almer1984
It is possible to query more than one custom field by first allowing for multiple $_GET variables in your pre_get_posts
filter. To do this, simply copy and paste your onderwerp
code and change the field_name.
You will need to change quite a bit of your JS to allow for multiple values to be added to the URL. I would advise that you write a function that returns the URL based on all the selected checkbox values.
You can then attach another ‘click’ event to the second checkbox inputs and use this function to redirect the URL.
I would just like to point out that this PHP and JS logic is quite advanced, and I won’t be able to help much on this free ACF support forum. If the task seems too complicated, perhaps try breaking it up into steps and research these independently.
Hope that helps.
Thanks
E
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.