Bug with Images in Twenty Eleven

  • Unknown's avatar

    Hello! This is the second time I’m posting this issue; hoping someone can help this time around.

    I’ve noticed a problem with the way my theme is posting images. If you look on this post :: http://itstwoam.wordpress.com/2012/03/18/sunday-seedlings/ you can see that the first image has no grey line border, as the rest of the images do.

    Looking at the code I see that the first image

    <img title="Seedling Light Stand" src="https://itstwoam.files.wordpress.com/2012/03/sunseedstand.jpg" alt="Seedling Light Stand" width="389" height="583" />

    is different than the second image

    <img class="alignnone size-full wp-image-1147" title="Baby Maters" src="https://itstwoam.files.wordpress.com/2012/03/sunseedmaters.jpg" alt="Baby Maters" width="583" height="389" />

    because the second image contains the class=”alignnone size-full wp-image-1147″

    Two issues ::
    1. Obviously, I can cut and copy the additional class element, except I do not understand how the wp-image-xxxx number is generated. Where does this number come from?
    2. I’ve noticed this problem in several posts, one such being :: http://itstwoam.wordpress.com/2012/03/15/truth-in-advertising-or-blogging-for-that-matter/
    I thought originally that it might be the particular window I was using to insert the images, but a post I made last night contained one images missing a border, while the others were fine, even though all the images in question were uploaded at the same time AND were inserted into the post the same way. I was able to correct by deleting the image then reinserting, but I do not want to have to do this every time the border isn’t added, especially with older posts where I may not have originally moticed the discrepancy. Seems like something may be a bit buggy.

    Thanks for any help/advice/looking-into anyone is able to do.
    -C

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there,
    I see what you mean and I’m flagging this thread so it gets moved to the Themes Forum. There our Theme Team Staff will respond to you.

  • Unknown's avatar

    moved to Themes Forum

  • Unknown's avatar

    Thanks for the move and the bump… hope someone can help out!

  • Hi itstwoam,

    The classes should be automatically added to the image tag when you click “Insert Into Post” button. I know you’ve said they were inserted into the post in the same way but there must be some differences between the ones have the classes and ones that don’t.

    Could you think of any difference when how you’ve inserted them into the post?

  • Unknown's avatar

    iamtakashi :: No, there was no difference, hence the reason I am suggesting there is a bug with the theme. Because I have noticed this problem in earlier posts, I was deliberate in the method in which I inserted the images. I uploaded them, wrote in my post, used the add media button, then clicked on gallery, changed the title, the alt tags, removed the hyperlink, and hit insert image. It was the same method for every image, yet the class was left off of the one. Note :: I do not change the default settings of full size image, or alignment. I did not edit the code directly, but used the GUI.

    There are time when I insert an image directly in the upload window, or after navigating through the media menu, but as I’ve already stated, because I’ve noticed the problem with the image frame, I have made sure that I use the same process for every image to see if that was the problem. However, even if I was navigating through the upload window OR the media menu to insert images, it really shouldn’t make a difference, the class should still be applied as I am not do anything specific to remove/override the class.

    I can work around the “bug” if I knew how WP was defining the seemingly random image number so I could insert the style by cutting and pasting the HTML. But the

    wp-image-

    four digit number appears to be unique to each image, and I’m not sure where to grab that info.

    Thanks for looking into it.

  • That is weird. I can’t replicate the issue you are having with the method you’ve described, even with your image.

    Looking at your other posts, it seems to happen not all the time but sometime because images on other posts are working as they should be.

    I doubt this is a theme specific bug. Because if it was we should be getting similar reports from other users because Twenty Eleven is one of the most popular theme but I don’t remember seeing this issue from other users.

    > I’m not sure where to grab that
    If you go to Media -> Library and click the image in question, you will see the attachment ID in the URL in your browser.

    I’m sorry for not being very helpful but it’s very hard for me to see what’s going on if I can’t reproduce the issue. I’ll keep an eye on this thread and I will see if other users are having the same issue.

  • Unknown's avatar

    iamtakashi :: I know, it’s completely strange and, well, “buggy”. It doesn’t happen all the time, it only happens for certain images, and I didn’t even notice it until last week, then looked back in previous posts to see that it had missed other images as well. I’ll keep doing my thing, being super careful about my process, and see if there isn’t something that’s causing that class to fall off.

    Thanks for looking into it, and I’ll also keep reporting as it continues to happen (if it does!)

  • Unknown's avatar

    iamtakashi :: I’ve managed to capture/replicate the action that causes the bug with this image border disappearing.

    On this post
    http://itstwoam.wordpress.com/2012/04/19/what-a-week/
    I added all the images at once, uploading them via the gallery, and moved them around in the post using the shortcut keys for cut and paste. Somehow the classes are being dropped in the cache so that when I paste the image, the border goes ahead and disappears.

    I’ve been able to replicate this several times now, and it’s definitely the cut and paste via command -c -v that’s causing the issue.

  • Unknown's avatar
  • Hi itstwoam,

    Thanks for the information. I was able to replicate the issue when I cut/pasted the images using the keyboard shortcuts in the Visual Editor.

    I suggest switching to the HTML view if you would like to move images around using cut/paste. This ensures that the classes are preserved.

  • Unknown's avatar

    Will do! And thanks for looking into it.

    Any ideas why this would happen?

  • The Visual Editor it’s not really meant for HTML mark-up. If you have important markup that you don’t want to be stripped, it’s best to use the HTML editor, which is plain text.

  • The topic ‘Bug with Images in Twenty Eleven’ is closed to new replies.