I'm not sure why it returns Array, because as far as I know I don't retrieve the profile images from an array. See the following function.
function getTeam() {
global $post;
$team = new WP_Query();
$team->query('post_type=coaches');
if ($team->found_posts > 0) {
echo '<ul>';
while ($team->have_posts()) {
$team->the_post();
$listTeam = '<li>';
$listTeam .= '<a href="#" class="js-modal">';
$listTeam .= '<figure class="profile-img">';
$listTeam .= '<img src="' . get_field('profile-image') . '" alt="">';
$listTeam .= '<figcaption><span>Bekijk profiel</span></figcaption>';
$listTeam .= '</figure>';
$listTeam .= '</a>';
$listTeam .= '<p>' . get_field('biography') . '</p>';
$listTeam .= '</li>';
echo $listTeam;
}
echo '</ul>';
wp_reset_postdata();
} else {
echo '<p>No team members found</p>';
}
}
I've googled and found only two similar questions and in one of them a poster said by default images are returned as an array
So I added two variables and tried to retrieve the image like this:
$image = get_field('profile-image');
$profileImage = $image['url'];
$listTeam .= '<img src="' . $profileImage . '" alt="">';
But then I also get an empty value like this img src="" alt="" />
in my HTML.
For the rest I checked if the paths are right and they are and I don't get any errors. Thus... I'm a bit stuck here :)