Support

Account

Home Forums General Issues Relationship field display relationship related post

Solved

Relationship field display relationship related post

  • I have a post where there is a relationship field.
    the post that I select with the field has a relationship field to.
    I need to display get_the_title() of a second relationship field.
    Is it possible?
    Thanks in advance.

  • I solved it! I put in the foreach a new foreach with new question:

    $posts = get_field (‘relationship1’);
    foreach ($posts as $post) :

    $subposts = get_field(‘relationship2’, $post->ID);
    foreach ($subposts as $subpost) :
    echo get_the_title($subpost->ID);

    endforeach; endforeach;

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Relationship field display relationship related post’ is closed to new replies.