When I insert images into a blog post, wp is automatically inserted markup around the img element: specifically a div and a p (for the caption)…..where is that markup being generated in wp sourcecode?
Leave a Reply
You must be logged in to post a comment.
The p tags come from wpautop
have a look inside the media.php file in the wp-includes folder. In WP 3.4, around line 198. This is the function which generates the markup for images, and if I am not mistaken, you should be able to filter it in your functions.php file.