I have two custom post types, ‘Artist’ and ‘Media’. Various reasons for setting two post types. So currently, I add an image or video by creating a new Media post, I have an ACF relationship (artist) field that allows me to select an Artist. So the result I am trying to get to is for the user to go to /artist/artist-name and have all the media posts for that particular artist display.
Here are some screenshots of my ACF fields. So the first one is the ACF fields assigned to the Artist post type:
…which basically allows me to create an artist overview page.
Then for the Media post type I have this:
Notice the ‘artist’ relationship field.
When adding a new media post I have this:
…whereby, I set the artist that the image/film relates to.
On the frontend, this is where I am struggling, I have a single-artist.php file and I am scratching my head as to how I can list all media posts for the artist you are viewing?