title: Get a limited, text-only excerpt from a WordPress post?
body: <p>I'm using "The Loop" in my own theme template to get the last three posts from WordPress.</p>
  
  <pre><code>&lt;?php
  $args = array( 'numberposts' =&gt; 3 );
  $myposts = get_posts( $args );
  foreach( $myposts as $post ) : setup_postdata($post); ?&gt;
  
      &lt;!-- DATE --&gt;
      &lt;div class="date"&gt;
      &lt;?php the_time('m F Y');?&gt;
      &lt;/div&gt;
  
      &lt;!-- TITLE --&gt;
      &lt;div class="title"&gt;
      &lt;?php the_title(); ?&gt;
      &lt;/div&gt;
  
      &lt;!-- SNIPPET --&gt;
      &lt;div class="content"&gt;
      &lt;?php the_excerpt(); ?&gt;
      &lt;/div&gt;
  
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>Everything is working fine - except <code>the_excerpt()</code>. I need about 15-20 words of plain text from the post to show as a preview, instead of the full excerpt or the entire post content body. How do I go about doing this?</p>