When including a gallery in your WordPress post, the thumbnail is linked to a medium size version, which is then linked to the full size image, kind of frustrating, isn’t?
Well, I think it is, and I have often wondered why WordPress behaves like this, so today I did some research on the matter and found out that it isn’t WordPress fault that you get this awkward set up, of your WordPress gallery.
WordPress does exactly what it’s told to do. When there isn’t a corresponding page template present, WordPress select the next in line and presents the content on that one. If you would like your thumbnails linking to the full size picture, without going through the medium size first, you must add the correct page template to your theme.
However, that was something easy and I managed to do it in just a couple of minutes. Nevertheless, remember to do a backup of all important files, before you start to experiment with your WordPress files, then if anything goes south, it’s easy for you to restore your blog.
First open your single.php file and, save it as image.php.
Then find the loop code, which is the code that’s displaying your content on your page and looks something like this, in your theme,
<?php the_content(); ?>
Now, replace that line with the following code,
<?php if (wp_attachment_is_image($post->id)) {
$att_image = wp_get_attachment_image_src( $post->id, "full-size");
?>
<p class="attachment">
<img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>" class="attachment-full-size" alt="<?php $post->post_excerpt; ?>" />
</p>
<?php } ?>
Then upload your new image.php to your themes folder. Now, when you insert a gallery inside your post, the thumbnail will be lined to a page, showing the full size of the image. I found out that if image.php isn’t present, WordPress is told to use single.php instead, which causes the affect of medium size images, instead of the full.
Also, I would like to send some credit to the WordPress codex and their forum for helping me understand how this worked.

{ 3 comments… read them below or add one }
I think you love dark color
Hi,
this is exactly what I had been looking for! Why is that page not the first hit with my google keywords: ‘gallery wordpress full size’
I searched and searched all over the place to find THIS answer! Wordpress Gallery is so annoying with its ‘medium-size’ default.
Thanks again and a good day.
Thanks for you comment and I’m glad that my post helped you.