The WordPress WYSIWYG content editor helpfully wraps embedded images with paragraph tags, this is kind of nice as the vertical spacing that you’ve applied to your paragraphs in your typography style guide, will then of course then be applied to your inline images. Whilst this is usually desirable, sometimes we simply may just want control over this ourselves.

Place the following snippet into your theme’s functions.php file to prevent this behaviour.

 

Snippet

LEAVE A COMMENT

Notify of
avatar
wpDiscuz