title: Creating a recent posts widget for wordpress but ran into problems where it displays info from the first post
body: <p>Hey guys I am making a Widget to display a posts title, and excerpt from that post, and its date. The code I have is here:</p>
  
  <pre><code>public function widget( $args, $instance ) {
  
  
          extract( $args );
  
          $headline = $instance['headline'];
          $category = $instance['category'];
          $numberposts = $instance['numberposts'];
          $readmore = $instance['readmore'];
  
  
          echo $before_widget;
  
          echo $before_title;
  
          echo "&lt;p class=\"headline\"&gt;$headline&lt;/p&gt;";
  
          echo $after_title;
  
          $args = array( 'numberposts' =&gt; $numberposts, 'category_name' =&gt; $category );
          $recent_posts = wp_get_recent_posts( $args );
          foreach( $recent_posts as $recent ){
          echo '&lt;a href="' . get_permalink($recent["ID"]) . '" title=" '.esc_attr($recent["post_title"]).'" &gt;' .   $recent["post_title"].'&lt;/a&gt; ';
          echo the_time('F j, Y');
          echo the_excerpt();
  
          }
  </code></pre>
  
  <p>As you can see I am trying to call the time and the excerpt from the post. It is working but it is only displaying the date and and excerpt from the very first post that is called welcome. I want it to display the Date and excerpt from each individual post. I will post a link to the site with the widget in the side bar. Sorry if I am not being clear enough or if more info is needed I am very new to this.</p>
  
  <p><a href="http://www.modmacro.us/wpsandbox/" rel="nofollow">http://www.modmacro.us/wpsandbox/</a></p>