WordPress.org

Support

Support » How-To and Troubleshooting » Image not attached to post

Image not attached to post

  • kristarella
    Member

    @kristarella

    Hey, I’m not sure if this is intended behaviour or a bug or just annoying.

    If you upload an image to a post that hasn’t been saved with a title yet the image is not attached to the post.

    I did a test where I uploaded an image before anything else, uploaded image after entering a title, uploaded after entering title and clicking in the post textarea and uploaded after writing post text, but not entering a title…

    Only in the instance when the post title was entered and after clicking in the post textarea (which triggers an autosave) was the uploaded image attached to that post.

    I don’t think this happened in previous versions of WordPress because I’ve never had the problem before, but its possible that I’ve suddenly changed my habits and when posting to a photoblog uploading it is the first thing I think to do… whatever it is it’s a bit annoying.

    I can change my order of operation if I really need to, but it seems to me that entering any content, whether it be image, title or post content should trigger an autosave, thus making the post ID available for the image uploader to attach the image to that post.

    Any thoughts, opinions or insight into this?

Viewing 15 replies - 1 through 15 (of 26 total)
  • Aaaaaaah thanks for posting this, it explains the stupid bug I had yesterday because I put the image first thing!
    Well I totally agree with you, it’s annoying, and I would very much like to have it solved as well 🙂

    Should be resolved, for sure

    kplicanic
    Member

    @kplicanic

    Having the same issue. Only now, image titles are coming up MANDATORY? It won’t let me insert an image without one, AND… once inserted, the title is showing up in the post itself. Anyone know a fix?

    I’m having the same problem, images not attached to posts…

    is this the reason? I never tested it

    Thanks! At least knowing this is some sort of solution, until it comes a definitive one…

    kristarella
    Member

    @kristarella

    @kplicanic — I think image titles have always been mandatory, which is why they are automatically generated, so that it doesn’t have to hassle you to enter one. The title is then used for the title and alt attributes of the image. The alt attribute is important; all images should have one and it will be displayed if for some reason the image isn’t (e.g., if the user has images turned off in their browser, or if the image URL can’t be accessed).

    If you want to add images without creating a new post, then use the media options…

    It makes perfect sense that if you don’t make a post, then the images added to that post should not exist either…

    If you want to add images, or media without creating a new page or post then use the “Media” options… (just below posts in the left-hand menu)…

    t31os_, but that is not the problem! the thing is, when you upload an image on a post without title (the post), the image doesn’t get attached to that post

    that is not really a problem on some wordpress installs, but if you are using a magazine style theme, with a plugin like get the image that takes the thumb from the image attached to the post to show it on frontpage, it really is annoying…

    thanks

    Why would the post not have a title?

    If you’re saying that using this plugin requires that your post does not have a title or doesn’t require posts to have one, then that’s hardly WordPress’s fault…

    If a post doesn’t have a title, then it’s not a complete post, and as such i’d expect WordPress to treat it as such…

    It seems to me WP behaves as it should do, but the behaviour does not tie in with what you want to do..

    Justin Tadlock
    WordPress God

    @greenshady

    Why would the post not have a title?

    No one is saying a post wouldn’t have a title. They’re saying you must enter a title and click in the content editor box before uploading an image. Otherwise, it won’t be attached.

    If you’re saying that using this plugin requires that your post does not have a title or doesn’t require posts to have one, then that’s hardly WordPress’s fault…

    He said the plugin required post attachments, nothing about the title.

    If a post doesn’t have a title, then it’s not a complete post, and as such i’d expect WordPress to treat it as such…

    Writing a title is not a requirement of writing a post. But, that’s besides the point of this topic.

    Ok, i do get that…

    If you have not yet entered a title or clicked into the content area, then essentially you’re trying to add an image to a (so far) non-existent post, after all, 2 empty boxes does not constitute a post right? …

    Perhaps i’m misunderstanding this, apologies if i’ve offended someone, i just feel that WordPress is acting as i would expect it to.

    Again, i’m trying to not offend someone, simply pointing out how what is being described could be interpreted as normal operation. I appreciate my responses could come across as “blunt”, but please don’t be offended…

    t31os_, let’s suppose this:

    you have a great photo… really great, you have fallen in love with that picture

    so, you open your wordpress editor, and the first thing you do, is upload it… right? and put it on an empty post

    you haven’t written a title, not even a post. just the picture

    inspired byu the picture, you write the post. a great post. now, you didn’t think of a title yet… you just have written something, with a picture… all right, then you write a title… ta da! now you have a post…

    so, you publish it… but wait!!! what just happened??? where is my picture?

    NOW you get the idea’

    Ok i think i get what it is you’re saying…

    So i went and gave it a shot….

    1. Logged into admin.
    2. Clicked Add new under Posts.
    3. Clicked the media button.
    4. Choose to upload file from computer, gave it a caption, description etc..
    5. Clicked insert into post.
    6. Wrote some text after the image, clicked preview.
    7. Preview shows the image plus text.
    8. So i add a title.
    9. Click publish.
    10. View post, all is as expected, image, text and title.

    Ok so i thought should i be testing with a title, so again.

    1. Add new post.
    2. Avoided clicking into the content or title areas, clicked the media button.
    3. Clicked add from computer.
    4. Entered a caption and description.
    5. Clicked insert into post.
    6. Clicked publish.
    7. Again the post shows up with the image. (although the auto title ended up as “301” literally, 301 is the title)

    In both cases the image appeared in the post…

    Am i still missing something?

    take a look at your media library, and see if that image is attached to a post

    Yes it is, it does say (no title) under “attached to”, but that text links to the correct post.

    elcarpo
    Member

    @elcarpo

    well, SOMETIMES they won’t

    that’s the problem, you can’t just guess WHEN will this happen, and is driving me crazy…

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Image not attached to post’ is closed to new replies.