WordPress.org

Ready to get started?Download WordPress

Forums

Image not attached to post (27 posts)

  1. kristarella
    Member
    Posted 5 years ago #

    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?

  2. EjMana
    Member
    Posted 5 years ago #

    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 :)

  3. ioni
    Member
    Posted 5 years ago #

    Should be resolved, for sure

  4. kplicanic
    Member
    Posted 5 years ago #

    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?

  5. elcarpo
    Member
    Posted 5 years ago #

    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...

  6. kristarella
    Member
    Posted 5 years ago #

    @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).

  7. Mark / t31os
    Moderator
    Posted 5 years ago #

    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)...

  8. elcarpo
    Member
    Posted 5 years ago #

    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

  9. Mark / t31os
    Moderator
    Posted 5 years ago #

    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..

  10. Justin Tadlock
    Member
    Posted 5 years ago #

    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.

  11. Mark / t31os
    Moderator
    Posted 5 years ago #

    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...

  12. elcarpo
    Member
    Posted 5 years ago #

    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'

  13. Mark / t31os
    Moderator
    Posted 5 years ago #

    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?

  14. elcarpo
    Member
    Posted 5 years ago #

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

  15. Mark / t31os
    Moderator
    Posted 5 years ago #

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

  16. elcarpo
    Member
    Posted 5 years ago #

    well, SOMETIMES they won't

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

  17. kristarella
    Member
    Posted 5 years ago #

    @t310s_

    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...

    Yes, as I've thought about it, it makes a bit of sense. Although I find it odd that certain activites trigger the draft to save, but clicking on the upload button is not one of those things.

    I originally created this thread because it struck me as odd that my photos were only getting attached to the post sometimes and in the last 3 years of using WordPress I'd never noticed such a problem. It turns out that this behaviour only presented itself in 2.8. So I could have been uploading images before adding title or content previously and they were attaching themselves to the post, thus my confusion when they stopped.

    If your recent tests result in the image being attached to the post, then perhaps this behaviour has been changed again in 2.8.1 or 2.8.2. Will look into it.

    @everyone annoyed by the behaviour
    There is a post that might help WordPress Gallery New Post Ghost Bug

  18. Mark / t31os
    Moderator
    Posted 5 years ago #

    I don't personally use a whole lot of images, nor tend to create posts that have an imagery focus, so i've not come across it before, though i can appreciate a change in behaviour can be frustrating...

    I hope you find something to resolve your problem in any case... ;)

  19. elcarpo
    Member
    Posted 5 years ago #

    @kristarella, have you tried the fix from 3dogmedia? did it worked?

  20. kristarella
    Member
    Posted 4 years ago #

    Sorry, haven't had a chance to try it yet.

  21. elcarpo
    Member
    Posted 4 years ago #

    @kristarella, i did it, and it seems to have solved it...

  22. kristarella
    Member
    Posted 4 years ago #

    I just tested the image upload with v2.8.3 and the image was not attached to the post when it was uploaded before anything else on the page was touched, so it seems the behaviour hasn't changed since 2.8.0...

    I haven't tried the fix, I think I'll just remember to tap the post textarea before I upload anything for now, but I'm glad it seems to be working.

  23. luckie777
    Member
    Posted 4 years ago #

    I'm running 2.9.1 & this bug appeared out of no where. One minute the images appeared next to the post and then not!

    Has there been any patch for this from WordPress?

    Thanks,

    Luckie.

  24. luckie777
    Member
    Posted 4 years ago #

    BTW -- this bug happens even if you have a POST with a title and an IMAGE with a title & attempt to attach them >> the post + image do not display together.

    Urghhh... so annoying!

    L.

  25. jbbrwcky
    Member
    Posted 4 years ago #

    I am also experiencing this issue. I think it's theme related, in the functions.php file, because when I switch to a default theme and upload an image and insert it into the post it goes in fine. When I switch to the development theme it won't.

  26. mores
    Member
    Posted 4 years ago #

    How can it be theme related? The frontend has no influence on the back end.
    Just look in the media library and you'll see that images don't get attached to posts unless the post has been saved first.
    If you insert the image manually into the post then yes, the image will show up. But it's not a "child" of the post as it should be when you use a theme that displays attachments automatically.

    Annoys the heck out of me too because I'm so used to finishing everything and THEN pressing the publish button. Now I need to save manually, then upload, then publish.

  27. kristarella
    Member
    Posted 4 years ago #

    There could be themes that have functions that affect the image uploader, but if that's the problem you're having, it's not the same problem this thread is talking about.

    @mores You shouldn't need to manually save your draft to allow image attachment unless you have autosave turned off. You only need to have triggered an autosave. From what I can tell, adding a title does not trigger an autosave, but clicking in the post writing textarea, or adding categories do.

Topic Closed

This topic has been closed to new replies.

About this Topic