In regards to image attachments inserted into a post, I would like to wrap the img tag inside a div tag for specific design purpose.
Is there a way to do this automatically after attaching the image file, like through hooks/filters maybe?
Thanks in advanced!!
It’s the image_send_to_editor filter:
For existing images/posts you can try the regex in the function below
Not looked into hooks and filters, but it is easily achievable by css alone.
Using the
2010 theme
and class=”entry-content” as the css selectorIn your stylesheet use: