Support » Fixing WordPress » How to make link to "large" image instead of full size?

  • Resolved Dario Devcic


    When you insert image into post there is option to link this image to larger image, but this larger image is always full-size of uploaded image. There is no option to choose size of target image. Is there some plugin or modification to make images linked to “large” (“large” is set in media settings) versions of images instead of full-size?

Viewing 15 replies - 1 through 15 (of 23 total)
  • How large is your uploaded image and what are the dimensions of your Large image in Settings -> Media?

    I believe if you set the insert to Post URL (using attachment page) instead of File URL then it’ll be whatever size you’ve set it to.

    Dimensions of Large image in Settings -> Media is Max Width 1024 and max Height 1024. When I upload larger images (eg.1600×1200) wordpress will upload this image and will create 3 more images; thumbnail, medium and large – as set in Settings -> Media. This far is ok.

    But, when you insert image into post and link this image to larger image you cannot choose size of this larger image – this larger image is not “Large” from Settings -> Media – this larger image is full-size of uploaded image. I need to find solution to make thumbnails (or wp-gallery images) link to “Large” versions of images instead of full size.

    Joseph is correct. For the default gallery, you’ll need to add some extra options to the gallery shortcode:
    [gallery link="file"]

    No esmi, Joseph refers to something else, this is not answer to my question. I have just found two older threads with same question but nobody answered.

    Esmi, if you refer to something like this [gallery link="file" size="medium"] this is not the answer because this will create gallery of Medium sized images but target files will be full-size images, not the Large.

    Just to clarify, in case anyone is confused, the size I was referring to is the size set when inserting into a post, not the sizes in media setting.

    If you always want it to link to the large size image then you’ll need to somehow add the dimensions to the end of the image filename in the URL.

    Perhaps there’s a filter hook that can be used?

    I’d be interested in a solution for gallery shortcode linking to ‘large’ images not ‘full’.
    WP makes a large, why not use it?
    Or even a custom defined size via the post-thumbnail feature.

    My users will be uploading gigantic files… so ‘full’ is not a option.

    It would be nice is there were something like this:
    [gallery link="file" attachment="full"]

    I think its a great idea.

    Or even more a place in wordpress where you can set up de defult [gallery] options

    link= file | atachement
    attachement= thmubnal|medium|large|ful

    Then you will not have to put the code for each [gallery]

    attachment.php looks like an answer

    If you make one, your attachments would be shown on it

    The WordPress Theme Single Post, Post Attachment, & 404 Templates

    Has some info on it…. you would just need to call in the appropriate image size on an attachment.php template

    Sorry, I think I’m not undertanding.

    the attachment.php relies on theme or in wordpress core files?

    That’s a theme file.
    If you create a attachment.php, in your theme directory, it will display for attachments in a more customized way. ‘image.php’ even more specifically.

    I recived you respons by email.

    Thank you

    This is very important for us purists that like using the gallery shortcode. You cannot use attachment.php if you are trying to link to the file. I agree with Mic’s solution

    [gallery link="file" attachment="full"]

    If anyone has any ideas let me know. This can probably be done with a custom function / filter.

    Just found this plugin. Does exactly this and a lot more.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘How to make link to "large" image instead of full size?’ is closed to new replies.