Hello,
I have 2 CPT "concert" and "artiste".
I am using Oxygen Builder and am trying to link a concert with several artists, in order to display their biography (content), title, photo (thumbnail image) and other custom fields.
I decided to use the "post" field type, cloneable to get the artists as concert fields.
(I was thinking of using MB relationships but didn't manage to make it work)
I try to display their biography and instrument in a code block :
<?php $post_ids = rwmb_meta( 'artiste_s_associe' );
foreach ( $post_ids as $post_id ) :
$nom_artiste = get_the_title( $post_id );
$instrument = rwmb_meta( 'instrument' );
$biographie = get_the_content( $post_id );
$photo = get_the_post_thumbnail_url( $post_id);
?>
<h3><?php echo $nom_artiste; ?> - <?php echo $instrument; ?></h3>
<div> <?php echo $biographie; ?>
<?php endforeach
?>
The value $nom_artiste displays the correct names, but I cannot reach out to have the content, it displays the content of the global post ID. Which function should I use ? Also, the custom fields are not showing, I suppose it's the same problem.
Could you tell me where I am wrong ?
Thank you,