• I have this issue with the order of P and Divs when I add an image. It seems to be mucking up the design. This is what some typical HTML looks like:

    <p>
    <div id="attachment_2045" class="wp-caption aligncenter" style="width: 500px"><img class="size-full wp-image-2045" title="new-sprite-google" src="https://www.malcolmcoles.co.uk/blog/wp-content/uploads/2009/04/new-sprite-google.png" alt="New google sprite (left); old google sprite (right)" width="490" height="191" />
    <p class="wp-caption-text">New google sprite (left); old google sprite (right)</p>
    </div>
    </p>

    (from https://www.malcolmcoles.co.uk/blog/new-google-sprite-july-2009/)
    I thought divs weren’t allowed in <p>s?

    It’s gone even odder on other pages:

    <p>
    <div id="attachment_1943" class="wp-caption aligncenter" style="width: 502px"><img class="size-full wp-image-1943" title="bbc-ashes-2005" src="https://malcolmcoles.co.uk/blog/wp-content/uploads/2009/04/bbc-ashes-2005.png" alt="Query deserves 4 years ago?" width="492" height="203" /><p class="wp-caption-text">Query deserves 4 years ago?
    </p>
    </div>
    <br />
    Update: It's taking it from the DMOZ entry according to the comment below. Odd behaviour ...
    <div class="tweetmeme_button" style="float: right; margin-left: 10px;">

    That one has got a whole chunk of text not in a <p> … The bit beginning Update.

    Anyone got any clues on what causes this?

Viewing 6 replies - 16 through 21 (of 21 total)
  • I’m having the same problem too on my self-hosted blog (running the current WP 2.8.6).

    As a real kicker, I even got it to break as you described with the WordPress MU installation running at WordPress.com!

    So given the above, it’s not just you, and I will speculate that it’s not (directly) the fault of your plugins or themes!

    Thread Starter malcolmcoles

    (@malcolmcoles)

    Essday – I have noticed a new quirk of this which is that the closing <p> is missing from my posts as well – ie the last paragraph of the actual content (before the comments area etc) has a beginning <p> but no closing one. Does yours do that too?

    EG if you go to my link above, the code looks like this at the end of the post:

    <p>Well, at least they're honest (if poor spellers)!
    <div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Fwww.malcolmcoles.co.uk%2Fblog%2Fim-a-celebrity-2009-itv-seo%2F&source=malcolmcoles&style=normal&service=bit.ly" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
    <h5> Etc Etc

    As you can see, the h5 kicks in – but the p hasn’t closed …

    Thread Starter malcolmcoles

    (@malcolmcoles)

    But I want a caption for my images! Is there no way to have a caption and valid HTML? I’m sure I’ve seen examples of this …

    I’m sure it *should* be possible without broken tags, but I think a bug in WordPress is preventing this from happening.

    If somebody here has the time, we need to file an actual bug report so that the developers see it. This probably involves creating a set of instructions to make it break starting from a known-good setup. Perhaps the WordPress MU installation on www.remarpro.com is the easiest place to do this.

    Is anyone interested in doing this? (I’m afraid that I don’t have a lot of free time right now!)

    Thread Starter malcolmcoles

    (@malcolmcoles)

    Essday: I’d be tempted if I knew it would work. But Esmi (above) says that he doesn’t see this bug on his wordpress installs … Not sure what he’s doing that we’re not ??

    OK. I was able to repro the issue myself on a base 2.9.1 install with no plugins and the default theme. The ticket is here. We’ll see what happens!

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Order of P and Div’ is closed to new replies.