Support

Account

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