Home › Forums › General Issues › Custom Post Type Relationship Archive Page › Reply To: Custom Post Type Relationship Archive Page
Then your query is correct. But if you want to query individual artists, you have to use a single-artists.php.
Another tip: If you name your variable $works and not $posts then it’s easier to read:
<?php
$works = get_field( 'featured_works' );
if( $works ):
foreach( $works as $work ):
echo get_the_permalink( $work->ID );
endforeach;
else:
echo sprintf( '<p>%s</p>', __('No work here...') );
endif;
In your field ‘featured_works’ you have an object with work?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.