WordPress.org

Ready to get started?Download WordPress

Forums

Cursor position after inserting captioned image (12 posts)

  1. gheyes
    Member
    Posted 2 years ago #

    I'm using a modified TwentyTen theme on my blog. When an image is inserted using the visual editor and the image has a caption the editor text entry position is at the end of the caption rather than just after the image. So, if you start typing your text is added after the caption, if you add another image the second image appears inside the box containing the first image with some very nasty visual effects. Is this the normal behaviour? I would have thought that, after inserting an image captioned or un-captioned, the text entry point should be outside and after the box containing the image.

    I hadn't noticed this until my wife added a blog entry and asked me to proof read it. We have different writing styles and I'm not sure what I normally do that has caused me not to see this before.

    Despite joining this forum I've been running a WordPress blog on either a self hosted machine, or a commercial hosted service but my installation, for several years. I normally don't ask for help but this has me stumped!

  2. deepbevel
    Member
    Posted 2 years ago #

    Post a link so I can see what you mean. although it sounds like normal behavior. If so, there are ways around it I'm sure.

  3. gheyes
    Member
    Posted 2 years ago #

    Here is a link to a page showing the issue http://www.heyeshome.net/?page_id=2362

    I inserted the first image then, without typing anything into the visual editor inserted the second image. Is this a bug or a feature? Either way is there a way to ensure that the insertion point is always after an image rather than at the end of the caption?

  4. deepbevel
    Member
    Posted 2 years ago #

    can you post the image code exactly as exists in the html editor?

    if more than 10 lines use patebinthen post the link.

  5. gheyes
    Member
    Posted 2 years ago #

    [caption id="attachment_2338" align="aligncenter" width="224"]<img class="size-medium wp-image-2338" title="Mystery being solved" src="http://www.heyeshome.net/wp-content/uploads/2012/06/P6050001-224x300.jpg" alt="" width="224" height="300" /> Mystery being solved.
    <div class="mceTemp mceIEcenter"><dl id="attachment_2340" class="wp-caption aligncenter" style="width: 310px;"><dt class="wp-caption-dt"><img class="size-medium wp-image-2340" title="Odd Block" src="http://www.heyeshome.net/wp-content/uploads/2012/06/P6050003-300x224.jpg" alt="" width="300" height="224" /></dt><dd class="wp-caption-dd">This block had to be corrected.[/caption]
    </dd></dl></div>
    `

  6. gheyes
    Member
    Posted 2 years ago #

    As you can see the HTML is messed up. What is the [/caption] doing inside the last dd tag?

  7. This is a known issue. There's a ticket for it on the WordPress Trac: #19389.

  8. deepbevel
    Member
    Posted 2 years ago #

    this is how my code looks, looks like you don't have the closing caption tags?

    [caption id="attachment_92" align="alignnone" width="260"]<a href="http://www.foursticks.net/foursticks/gallery/003-2/" rel="attachment wp-att-92"><img src="http://www.foursticks.net/foursticks/wp-content/uploads/2012/05/003-2-260x300.jpg" alt="" title="003 (2)" width="260" height="300" class="size-medium wp-image-92" /></a> this is a caption[/caption]
    
    text below the caption image
    
    [caption id="attachment_91" align="alignnone" width="300"]<a href="http://www.foursticks.net/foursticks/gallery/001-001/" rel="attachment wp-att-91"><img src="http://www.foursticks.net/foursticks/wp-content/uploads/2012/05/001-001-300x254.jpg" alt="" title="001-001" width="300" height="254" class="size-medium wp-image-91" /></a> this is another caption[/caption]
    
    more text below another caption image

    live demo

  9. gheyes
    Member
    Posted 2 years ago #

    Exactly, it looks like a bug to me but I'm not sure where it is, how it got introduced, and if it's unique to my site.

    Basically the reproducible way to get it is to insert one image then insert a second one without typing anything into the editor. If you hit return between inserting the first and second image then the problem goes away.

    If you don't have that behavior then I'll go away and dig deeper into my setup. I did have some editor related plugins installed but they have been deactivated for some time because I didn't know if they were compatible with the latest WordPress. It may be that one of them has left something corrupted.

    If you look at the code that got generated the first image has a proper caption tag:

    [caption id="attachment_2338" align="aligncenter" width="224"]

    while the second image has tags:

    <div class="mceTemp mceIEcenter"><dl id="attachment_2340" class="wp-caption aligncenter" style="width: 310px;"><dt class="wp-caption-dt">

    instead.

    Thanks for the help so far. I'll have time to rummage in the code tomorrow and let you know what I find.

    `

  10. deepbevel
    Member
    Posted 2 years ago #

    indeed, in the visual editor, if I insert one image from the media uploader, then repeat with another, without typing into the field, I loose the caption on the first image, but get the second.

    if I go to html after, this is what I see:

    <a href="http://www.foursticks.net/foursticks/gallery/001-001/" rel="attachment wp-att-91"><img class="size-medium wp-image-91" title="001-001" src="http://www.foursticks.net/foursticks/wp-content/uploads/2012/05/001-001-300x254.jpg" alt="" width="300" height="254" /></a>
    
    <dl id="attachment_92" class="wp-caption alignnone" style="width: 270px;"><dt class="wp-caption-dt"><a href="http://www.foursticks.net/foursticks/gallery/003-2/" rel="attachment wp-att-92"><img class="size-medium wp-image-92" title="003 (2)" src="http://www.foursticks.net/foursticks/wp-content/uploads/2012/05/003-2-260x300.jpg" alt="" width="260" height="300" /></a></dt><dd class="wp-caption-dd">this is a caption</dd></dl></div>

    shoves it all into a single div, If I do the same in the html editor, it's fine. I never use the visual editor, so never knew about this.

  11. pbut
    Member
    Posted 2 years ago #

    Sirs, I am having exactly the same issues.
    I am using the media library to insert my images into a post
    Inserting an image with caption and the cursor is in the grey caption box and I cant get it out to insert the next photo.
    If i do insert it stays in the caption box.
    I am new at wordpress and themes - so please be patient!!
    I am using Imbalance (not imbalance 2) and firfox as my browser.
    it is so frustrating since I want to go live and I'm a photographer, using wordpress as a photographic blog.
    http://www.pierrotphoto.co.uk
    Any help will be greatly appreciated
    Pierre

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    Please post your own topic.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.