• Resolved kveten2018

    (@kveten2018)


    Hello there,

    I’m trying to find the cause of this since yesterday, googled it – did’n find nothing about it. I have a couple WP sites (local and live) and yesterday I’ve noticed some differences in WP behaviour. When I click “view” under any image in my media library it shows up as a post i.e. “mysite/picture”, it has comment section, name of the site etc…But in my another WP install it works as it should be working (IMO and what I recall it worked in the past) i.e. when I click on the “view” button it shows just the image itself – as a file “mysite/picture.jpg. I’m pretty sure I didn’t change anything in the core files, both installs are the same version of WP. I’ve tried to compare both setting side by side – but it’s the same. What is the right behaviour or how to achieve the “proper” view (just mysite/picure.jpg) in a fresh WP install? Thank you!

    • This topic was modified 6 years, 1 month ago by kveten2018.
Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter kveten2018

    (@kveten2018)

    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.

    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.

    Thread Starter kveten2018

    (@kveten2018)

    Thank you, Joy!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Image preview shows up as a post’ is closed to new replies.