title: Trying to loop advanced custom fields pro functions .php
body: <p>I am using Advanced Custom Fields with wordpress but I am having an issue getting it to work with creating a short code. I want to drive my team-member post type with a short code that I Can add into visual composer but I am getting an error this is what I have tried.</p>
  
  <pre><code>function team(){ 
  
  
     // get posts
     $posts = get_posts(array(
      'post_type'         =&gt; 'team-member'
  
     ));
  
  
       if( $posts ): ?&gt;
  &lt;?php foreach( $posts as $post ): 
     setup_postdata( $post );       
  
    $description = get_field('description');
    $name = get_field('name');  
  
    ' i want to loop here to print out every team member 
  
      $cnt='';
      $cnt.='&lt;sction class="row ev-home-4"&gt;';
          $cnt.='&lt;div class="col-sm-12 owl-carousel owl-theme" id="teams"&gt;';
              $cnt.=' &lt;div class="item ev-home-4-block"&gt;
                          &lt;div class="col-sm-12 ev-home-4-block-1"&gt;
                              &lt;img src="'.get_site_url().'/wp-content/uploads/2017/11/test-1.png" class="img-responsive"&gt;
                              &lt;div class="row row2 ev-home-4-block-2"&gt;
                                  &lt;h2&gt;'.$name.'&lt;/h2&gt;
                                  &lt;small&gt;'.$description.'&lt;/small&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;';
  
  
  
  
          $cnt.='&lt;/div&gt;';
      $cnt.='&lt;/sction&gt;';
  
      &lt;?php endif; ?&gt;
  &lt;?php endforeach; ?&gt;
      return $cnt;
  }
  add_shortcode('team','team');
  </code></pre>
  
  <p>But I am getting the following error</p>
  
  <p><a href="https://preview.ibb.co/iJsi5G/chrome_2017_12_07_22_37_54.png" rel="nofollow noreferrer">https://preview.ibb.co/iJsi5G/chrome_2017_12_07_22_37_54.png</a> </p>