title: WordPress - custom excerpt printing <a> text inside a <p> when it shouldn't
body: <p>I may need to work on the titling of this.</p>
  
  <p>I have a function:</p>
  
  <pre><code>function excerpt($limit) {
          $excerpt = explode(' ', get_the_excerpt(), $limit);
          if (count($excerpt)&gt;=$limit) {
              array_pop($excerpt);
              $excerpt = implode(" ",$excerpt).'...';
            } else {
              $excerpt = implode(" ",$excerpt);
            } 
          $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
          return $excerpt;
      }
  </code></pre>
  
  <p>And I'm calling it with <code>&lt;?php echo excerpt(25);?&gt;</code>. This is what my HTML looks like:</p>
  
  <pre><code>&lt;div class="recent-meta-excerpt"&gt;
                              &lt;?php echo excerpt(25);?&gt;
                              &lt;a class="read-more" href="&lt;?php the_permalink(); ?&gt;"&gt;Read More &lt;i class="fa fa-long-arrow-right"&gt;&lt;/i&gt;&lt;/a&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>It's outputting like this:</p>
  
  <pre><code>&lt;div class="recent-meta-excerpt"&gt;
     &lt;p&gt;It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout....                           &lt;a class="read-more" href="http://www.stepyouraimup.com/blog/no-featured-image/"&gt;Read More &lt;i class="fa fa-long-arrow-right"&gt;&lt;/i&gt;&lt;/a&gt;
     &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But I don't want the <code>&lt;a&gt;</code> inside. When I'm calling the excerpt the <code>&lt;a&gt;</code> isn't even inside so I'm not sure how it's being wrapped in a <code>&lt;p&gt;</code>.</p>