Wordpress annoyingly puts all images within paragraph tags.
Does anyone know of a function that would basically either remove the paragraph tags for the image or apply a class to the opening tag.
Obviously preg_replace is the ideal candidate but the regex is way beyond my current understanding of it.
<p><img class="alignright size-full wp-image-4" title="Letters" src="/uploads/2009/11/temp-skh-image.jpg" alt="Letters" width="490" height="594" /></p>
to
<img class="alignright size-full wp-image-4" title="Letters" src="/uploads/2009/11/temp-skh-image.jpg" alt="Letters" width="490" height="594" />
Thanks in advance.