I don’t use ACF myself, but what you’re essentially needing to do is to be able to add a series of tags to images. There’s a tutorial here that explains how to do it with ACF:
https://www.greengeeks.ca/tutorials/article/add-custom-fields-to-media-wordpress/
You then need to use ACF to add an ‘image tag’ to the artist profiles. Something that you can use to re-unite the artist with their photo.
So lets say for the artist you have 'gallery-tag' = 'alice-dutton'
.
Then for the images, as you upload them, you fill out 'artist-tags' = 'alice-dutton'
.
Two artists? 'artist-tags' = 'alice-dutton', 'steve-buscemi'
So basically the way page, post, category and tag slugs
work.
Once you have that set-up in a manner that works for you, on the actual Artists page, you’d have to run a query for attachements that have an artist-tag
that matches the artists gallery-tag
.
As a standard WP_Query it would look like this:
$gallery_tag = get_post_meta( $post->ID, 'gallery-tag', true ); //this would get 'alice-dutton'
$gallery_qquery = new WP_Query( array(
'post_type' => 'attachement',
'posts_per_page' => -1, //gets all of them
'meta_query' => array(
array(
'key' => 'artist-tag',
'value' => $gallery_tag
)
),
) );
And then you’d run your output for the $gallery_query
.
You’ll have to go through the ACF and Elementor documentation to sort out exactly how to do it – I’ve never built a full project with either and have work with them very, very few times. But from my reading this shouldn’t be a problem.