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

    <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("news_source",$recent["ID"]) . '</p>';
     }
 ?>
</ul>

It looks your are passing get field parameters incorrectly. I assumed “news_source” is your custom field name in acf.

tech