Support

Account

Home Forums General Issues Filter relationship field by key from another field

Helping

Filter relationship field by key from another field

  • Hi All,

    Say that I have a field called Type and it has options like:

    Type A
    Type B
    Type C

    And after that I have a relationship field that is showing when Type B or Type C have been selected and I want it to display posts that have been published under Type A.

    I have tried using this: http://www.advancedcustomfields.com/resources/acf-fields-relationship-query/

    But I couldn’t figure it out.

    Hope you can help me solve this question.

    Thanks!

  • The reason why is because you want to vary what is shown in the second field based in what is selected in the first field. This can’t be done using ACF without adding your own custom JavaScript to the admin and to be honest, I can’t help you do this. You’d need to filter what the ACF JS is sending in the AJAX call.

    The best work around for this would be to create conditional fields based on the first field that show posts from the selected type, and I’m going to be honest, unless Type is a taxonomy even this may not be possible to filter following the link that you posted. There have been many posts here on the forums about people having problems filtering relationship field choices by another custom field.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Filter relationship field by key from another field’ is closed to new replies.