I’ve discovered that it is impossible to insert an image with a caption at the beginning of a page/post that begins with a Heading tag (h2, h3, etc.) without gaining extra unwanted formatting.
We would usually place our cursor before the first character in the editor, then insert the image setting it to ‘Align Left’ (adds a float: left;). Without a caption, this would usually add the image tag within the first text block, whether a heading or paragraph tag. Then the text floats nicely around it.
But when the first line is a heading, and the image has a caption, the caption DIV is added before the text BUT an empty paragraph is added after (<p> </p>). So there is extra unwanted spacing on top of the first heading.
If we manually remove the empty paragraph in HTML view, it just adds it back in when switching to Visual view and publishing.
If the first line is a paragraph, though, it seems to work like you would expect and does not add the extra blank paragraph.
– Anyone have this issue before? How do you add an image with a caption before a heading?
– Any idea where in the code this would be happening so that whatever is NOT happening with a paragraph could be made to work with headings??
- The topic ‘[Plugin: TinyMCE Advanced] Add Image w/ Caption before Heading’ is closed to new replies.