• Hello,
    I would like to ask, if it is possible to do following:

    I have two post types: artists and exhibitions.

    Each exhibition has 1 to n artists and each artist has 1 to n exibitions.

    Now I have two csv files – artists.csv and exhibitions.csv. I would like to import them into wordpress.

    Each artist or exhibition has his unique id in the csv.

    How do I connect artists with exhibitions and exhibitions with artists via advanced custom fields?

    Also I have to be able manually connect exhibitions and artists after the impor in wp admin.

    I have set up custom fields exhibition_id and artist_id to each entry.

    Thanks for suggestions.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s difficult to manually enter multiple meta values in a single field in a way that’s usable for queries. (for example, all artists in a group exhibition’s artist_id field) I recommend implementing one of the objects as taxonomy terms assigned to the other. Then you can easily get all artists for an exhibition or all exhibitions for an artist, as well as many to many sort of relations.

    There are fewer fields for taxonomy terms than posts, but term meta is supported, so all relevant data can still be saved with the term. If you must use post types for both, I’d still implement a taxonomy and relate one of the post objects to its taxonomy term through either post or term meta. Just don’t do both or an internal discrepancy between relations could develop.

Viewing 1 replies (of 1 total)

The topic ‘Import posts with relations’ is closed to new replies.