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.