Site icon Hip-Hop Website Design and Development

Syntax Issue: How Do I Call A Custom Field Inside a ForEach Statement?

I used the ACF (Advanced Custom Fields) plugin to create two custom fields (news_source and news_link) for a new post type (news). I’m trying to use the following code to display the title and the two new fields on my home page. It pulls the title but it doesn’t pull the custom fields even though I can see the custom fields on the single.php page. I think my syntax is wrong for the second echo statment because it isn’t returning a value between the paragraph tags. What did I do wrong?

<ul>
 <?php
    $recent_posts = wp_get_recent_posts(array('post_type'=>'news'));
    foreach( $recent_posts as $recent )
     {
       echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' .   $recent["post_title"].'</a> </li> ';
       echo '<p>' . get_field($recent["news_source"]) . '</p>';
     }
 ?>
</ul>