Support » Plugin: TinyMCE Advanced » [Plugin: TinyMCE Advanced] Add Image w/ Caption before Heading

  • 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??


Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m having this same problem. I noticed that it was images with captions but hadn’t noticed the association with H1, H2, etc. Now I see that is my problem as well. Would love to hear some feedback/suggestions anyone has to offer. In the meantime, I’ll keep looking.

    Plugin Author Andrew Ozz


    WordPress Dev

    Sounds like problem with the editor, not necessarily with the plugin. Will investigate further.

    Yes, most likely is the editor. After some research, I figured out adding <div> tags around the images keeps the extra paragraphs from being added.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: TinyMCE Advanced] Add Image w/ Caption before Heading’ is closed to new replies.