WordPress.org

Ready to get started?Download WordPress

Forums

Media library "view" link (9 posts)

  1. MrMastermindNL
    Member
    Posted 2 years ago #

    Hi,

    Is there a way to change the behavior of the "view" link in the media library overview when it is attached to a post? Now when I click "view" it tries to show the image in the post, which has a custom post type. I would like to change that to just show the image.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    when I click "view" it tries to show the image in the post

    Something is broken! Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.

    - resetting your custom permalinks back to the default setting via Settings -> Permalinks. If this works, then review Using_Permalinks before setting a custom permalink structure back up again.

  3. MrMastermindNL
    Member
    Posted 2 years ago #

    Thanks for your reply esmi. I think I found the problem. We've used /%year%/%month%/%postname%/ as a custom permalink structure. When I change back to default it is fine.
    I've also tested this on a clean WordPress install, there it does the same. As soon as I create a permalink structure it starts behaving like it did. So it changes from ?attachment_id=XX to the permalink of the attached post with the image name. Something like: url/post-type/year/month/postname/attachmentname

    Any way of avoiding that?

  4. MrMastermindNL
    Member
    Posted 2 years ago #

    Or is there a hook I can use to disable the view link completely?

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    The custom permalink structure that you've been using should be fine and it should not be causing this problem. I think this is an issue at the server level. There's something wrong with the way that the server is dealing with rewrites.

  6. ai
    Member
    Posted 2 years ago #

    I think this is inherent in WP now. I'm looking for a way to disable those pages that contain the images as well. They are showing up in Google results and people are finding ways of submitting pingbacks on these pages even though I have all pingbacks and trackbacks turned off.

  7. ai
    Member
    Posted 2 years ago #

    Bump. Can someone please provide a solution for this? We want to disable all the media "view" pages (prevent them from being public).

    Thanks

  8. ai
    Member
    Posted 2 years ago #

    I found a partial fix for anyone who is interested. I'd really like these pages to be completely gone, but at least here's some instructions (in the comment thread) on how to disable the annoying comments and pingbacks on media view pages.

    http://wordpress.org/support/topic/disable-leave-a-reply-on-images

  9. ceolfrith
    Member
    Posted 2 years ago #

    @MrMastermindNL

    Did the permalink solution continue to work for you? For me, it doesn't matter what permalink structure I use. I found that when you click on the "View" link, the image is displayed by single.php which, like you, isn't what I want. The only solution I have found is to hack single.php to only display the image. Since my site uses a custom post type instead of a "post" post type, it works. Obviously, this isn't ideal. What if somewhere along the line I need single.php for it's real mission. Anyway, I was just wondering. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic