• Hi!

    I have the following doubts about attaching images to posts and displaying them in posts.

    If we do not upload an image (image.jpg) directly through the Media Library but through a specific post (Post Sample), such an image is added to Media Library and automatically attached to this post.
    In this case, we get the following Attachment Page:
    https://domain.com/post-sample/image

    But we can first upload the image into Media Library, forgetting to attach it to the post. Next, we can add such an image to the post from Media Library.
    In this scenario, the image will stay unattached to the post.
    In this case, we get the following Attachment Page:
    https://domain.com /image

    The matter is more interesting when we activate any plugin which allows redirecting the Attachment Page to the Attachment Parent (For example All in One SEO).

    In the first case, the Attachment Page will be redirected to Post Sample, in the second case the Attachment Page will be opened.

    I checked that we can even display an image in one post (Post Sample 1) and attach it to another one (Post Sample 2).

    Could someone explain to me why WordPress works like this and what is the aim of that?
    First question is why Wordpres allows having an image in the post without attaching it to this post?

    If we activate redirecting the Attachment Page to the Attachment Parent we can find that some Attachment Page is not being redirected to post (as being in the post does not mean it must be attached to it).
    In some cases (if I make mistake) they can be redirected to the other posts in which they are not displayed.

    What is the proper way of working with images we want to attach to posts/pages?

    regards,
    Grzegorz

    • This topic was modified 3 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    That has been default behavior for a very long time. The actual reasoning may have been lost to time. Or it just happened that way and no one has done anything to change ?? I’m willing to speculate about the reasoning, if there was any. Different users have different preferences and work flows regarding attachment handling. What’s ideal for one is hated by the other. Allowing different behavior lets us choose which works best for us.

    The key is to work consistently. Choose a work flow you like and stick to it. Granted, easier said than done when a team of authors are involved. There’s likely a way to customize WordPress to behave more consistently, but that has been left for plugin devs and hasn’t been accommodated in core. I don’t know if any plugin devs have addressed this or not.

    Thread Starter Gregosz

    (@gregosz)

    OK ??
    Thanks for the explanation!
    Grzegorz

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attaching images to posts vs displaying them in the posts’ is closed to new replies.