Last updated on June 9, 2010. Tags: attachment page, image, WordPress core file
As stated in my previous post, the default configuration of the attachment page is that it displays the medium size version of the image (as configured in Settings » Media) and that medium-size image is a link to the actual image file in full size. In the previous post, we discussed how to remove the link and make it a simple image emdedded on the attachment page. In this post, we will tackle how to make it full size.
To make the attachment page display full image, open the post-template.php file in /wp-include/ folder using the text editor that comes with your hosting file manager. This is the same WordPress core file I mentioned in my previous post. The folder can be found in the folder where you installed WordPress.
Then, look for the following code:
$p .= wp_get_attachment_link(0, 'medium', false);
Replace the medium with full. Then save the file.
Then, refresh the attachment page and you will see that it's now displaying the full image.
One final tip: if you want the attachment page to display the full size image and this image is not a hyperlink, you can implement this tweak together with the one I discussed in my previous post about removing the link in image in the attachment page. This should be very easy since you only need to edit one core WordPress file: post-template.php.
Important notes:
Posted by Greten on June 9, 2010 under WordPress tweaks
Please double check your comment before clicking the "Post" button. Once you clicked it, there will be no way for you to edit your comment.
* Required. Your email will never be displayed in public.
Posted by Blain Reinkensmeyer on 08.03.10 2:50 am
You have no idea how long I have been looking for this simple fix for my blog… In fact, just so you know it has been over a YEAR. Ive had several coders look at this and they messed with the theme thinking it was one of the theme files. Yet it was so simple as a WordPress file.
THANK YOU for posting this fix!!!!!!!!!!!!!!!!
Posted by Greten on 08.08.10 4:39 am
You’re welcome =)