2 custom fields using same taxonomy

Support General 2 custom fields using same taxonomy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47124
    AnLipAnLip
    Participant

    Hi.
    I have a group field that concerns a CPT called "Designers". Each designer has info such as "name", "surname", "date of birth", "country", etc...
    In some cases, "Designers" is actually a duo of 2 designers, so I doubled these fields and added a suffix "_duo" to the custom fields.
    The problem is that the "Country" field is meant to be filterable, so I created a Taxonomy for it. When I add, for example a value "Italy" for the first designer (using field "designer_country") and "Switzerland" for the second designer (using field "designer_country_duo"), and try to pull these different values on the frontend, they bot will show "Switzerland".

    Is there a conflict between the fact that both custom fields refer to the custom taxonomy "Country", and doesn't like the fact that it is being provided 2 different values from 2 different custom fields ? Am I going to have to create a second Taxonomy called "Country_duo" ?

    #47133
    AnLipAnLip
    Participant

    For the moment the only workaround I have found is to change the field to a simple Select type, but then i lose the Taxonomy's possibility to have an archive for all posts that share the same "Country".

    What would be a better workaround ?

    #47136
    PeterPeter
    Moderator

    Hello,

    It isn't possible to use 2 taxonomy fields on the same page. The last field will set the post term and override the value of other taxonomy fields.
    If you want to save 2 fields designer_country and designer_country_duo, please use the taxonomy_advanced field. Following the documentation https://docs.metabox.io/fields/taxonomy-advanced/

    Or you can use one taxonomy field and enable multiple selections to select more terms for the post.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.