WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Empty p tags added into figure element (3 posts)

  1. daledude
    Member
    Posted 2 years ago #

    Hello, hope someone can offer some advice with this.

    I am aware of wpautop adding in P tags automatically, and how this can be disabled in the functions.php. But I can't do that as the people who will edit this site do not know HTML.

    Whenever I insert a figure element with figcaption, WordPress adds in a blank paragraph tag right after the image.

    So when I write (in the HTML editor, NOT VISUAL):
    <figure class="alignright"><img src="path/to/image.jpg" alt="text" /> <figcaption>Caption for the image</figcaption></figure>

    WordPress changes it to:
    <figure class="alignright"><img src="path/to/image.jpg" alt="text" /><p></p> <figcaption>Caption for the image</figcaption></figure>

    This creates an extra spacing between the image and the figcaption that is unwanted. A figcaption does not require any special other container, it is a block element itself. If I wrap the image in a div, the problem goes away. But I shouldn't have to do this.

    Thanks for any advice.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    It could be related to this issue: http://core.trac.wordpress.org/ticket/20381 - fixed for 3.4

  3. daledude
    Member
    Posted 2 years ago #

    Ah, yeah that looks to be the same issue. Glad to see someone was on it. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic