Support

Account

Home Forums General Issues Retrieving image url through relationship Reply To: Retrieving image url through relationship

  • I don’t know what

    
    $image = $bank[0]->bank_logo;
    

    is getting, but you can’t get an image field from a related post this way.

    Code here depends on what the relationship is returning. I am assuming that you have it set to return a post object

    
    $bank = get_field('bank_institution', $id);
    $image = get_field('bank_logo', $bank[0]->ID);
    

    You need to use the ID of the related post to get the field from that post