WordPress.org

Ready to get started?Download WordPress

Forums

Adjust image size in attachment page window? (4 posts)

  1. sm97os
    Member
    Posted 5 years ago #

    I am trying to set up my galleries so that when a user clicks on a photo, a new window is opened up with a large size of the pic and a header, etc. Currently, the gallery allows this basic setup, but the image resizes to a medium size. Anyway to code around this? ver. 2.7

    Thanks

  2. garycr5
    Member
    Posted 5 years ago #

    Yes - I've been trying to get around the same problem, no luck. Anybody have any ideas?

    Thanks

  3. thewpguru
    Member
    Posted 4 years ago #

    I managed to get some progress.

    I modified code in wp-includes/post-template.php . (am I supposed to do it there? where else? ideas?)

    In the function prepend_attachment where they are doing

    wp_get_attachment_link(0, 'medium', false);

    I changed to

    wp_get_attachment_link(0, 'large', false);

    There is still some logic that can get on your way though. It sorts of work smart now. This is what happens:

    Images that are larger than my blog's large size are being downsized to large - which is the improvement, before they were downsized to medium.

    Images that are smaller than the large setting are being left with their original size. I guess this could be good in some cases where you do not want a low quality image to be exploded. But it wont just make a smaller image to large size.

    It works perfect for me because I wanted at least quality images (large pixel size) to show to the maximum with of my post frame - which now works perfectly. The user can still click on the image to see the original image non-resized.

    Let me know if this helped.

    And please help me by letting me know what is the proper place to do this change as opposed to in the post-template.php

  4. thewpguru
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic