I am in the single-product.php loop and the product has a relationship to an artist post type to which I have the id off the artist.
I need to get the_title() from my custom artist post type while in the single-product.php loop.
My code is getting the title of the product rather than the artist. My code is below. Can anyone please help?
$artistId = get_field('artist'); $postId = get_post($artistId); if ( $postId ): setup_postdata($postId); ?> <span id="chty_17"> <dt><?php the_title(); ?></dt> </span> <?php wp_reset_postdata(); endif;