Joy
(@joyously)
As far as I remember, the Media Library’s View link has always shown the attachment page. The only images that the link is directly to the image is for images that WordPress generated, such as a cropped header image.
Ok, I guess I found the solution/cause (after a half day of testing every plugin installed). The site (with the image behavior I want) actually uses Yoast Seo plugin. Just installed this plugin to the 2nd site (fresh installation) and everything looks and works great! It’s under Search appearance>media and it’s on by default. The description explains it: “When you upload media (an image or video for example) to WordPress, it doesn’t just save the media, it creates an attachment URL for it. These attachment pages are quite empty: they contain the media item and maybe a title if you entered one. Because of that, if you never use these attachment URLs, it’s better to disable them, and redirect them to the media item itself.” Now when I click “view” in my media library I see wwww.mysite.com/wp-content/uploads/picture.jpg instead of wwww.mysite.com/picture. Also when I enter this “www.mysite.com/picture” in to a browser it doesn’t show me the post with the image anymore, it goes directly to 404 page – exactly how it should work! Also, I’ve checked a couple of random WP websites and half of them have this “problem” (IMO). If I pick any image on such site and manually add it to the address pattern I can see the single image with commenting options etc. Makes no sense to me, it’s useless. What is it good for?
-
This reply was modified 6 years, 1 month ago by
kveten2018.
-
This reply was modified 6 years, 1 month ago by
kveten2018.
Joy
(@joyously)
Well, in WordPress, images in the Media Library are stored exactly the same way posts are. They are a custom post type called attachment. So they get their own URL and comments even. It’s great if your have a photography site. Themes can have templates specific to the mime-type for attachments, so PDFs and videos and audios can be treated differently. There could be more content than just the file, depending on what you are doing (like download links, credits, description, even EXIF data).
Obviously, some people prefer it to work a different way, so they use a plugin to “fix” that behavior. But it’s not broken.