This code enables you to change the size of your images when displayed on the attachment page.
By default, WordPress is coded to display the medium size image.
1. You can change the size manually using CSS with the classes you can grab from the attachment pages source code like this:
.single-attachment img {
width: 100%;
height: 100%;
}
The CSS method is not efficient and will also produce poor resolution when increasing the size of images.
Or
2. Use the following code to change all existing image sizes on all attachment pages, which is more efficient. You could also use the following code with conditional tags.
Register or login to access the code :
Was This Tutorial Helpful?