Display ACF image field from User Profile page

I have created an ACF picture field and attached it with two user roles (Sponsor, members). Now I want to display that image on homepage with a filter of user type for show ACF image field by sponsors only on the homepage. Here is the code that I used so far.

   function add_sponsorLogo() {
    
    $author_id = get_the_author_meta('ID');
    $img = get_field('sp_logo', 'user_'. $author_id );
    
     echo '<img src="'.$img['url'].'"/>';
    }

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.