Home › Forums › Front-end Issues › Relationship returns array of string instead of post object › Reply To: Relationship returns array of string instead of post object
Thanks a lot!
I replace :
$values = get_post_meta( $title, 'du_meme_auteur', true);
by
$values = get_field('du_meme_auteur', $title, true);
and now my array is returning post object.
Thanks again!
There is still a tricky issue to display it with :
foreach($values as $agrege)
{
setup_postdata( $GLOBALS[$agrege]);
wc_get_template_part( 'content', 'product' );
}
echo '</ul></div></div></div>';
wp_reset_postdata();
but I avoid the problem with displaying it a different way. `
Cha
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.