WordPress allows you to specify three image dimensions via
Attachment Display Settings
When you are attaching an image to your post or page via the
The list for image sizes includes:
- Large, and
- Full Size
But what do you do when WordPress doesn’t let you select from all options? For example, it doesn’t show you the large option. This can happen if you define dimensions that are too large for your usual image uploads.
In that case, there is a simple way to manually override your selection from the Insert Media window.
If an option is missing in the drop-down list of image sizes, then select the next (larger) image size. In this case, this is the full size option.
Then click on the
The code inserted into your post or page will be something like this:
<img src="image_url" alt="image_alt_text" width="760" height="485" class="alignright size-full" />
On my blog the maximum width of an image attached to a post or page is 620 pixels.
If you don’t know the correct maximum width, then
Now that I know the correct maximum width of a large image, I can do the following calculation:
Step 1: width of large image / width of full-size image = x
Step 1: 620 / 760 = 0.815
Step 2: x * height of full size image = height of large image
Step 2: 0.815 * 485 = 395
Use three or four decimal points in the result of step 1. And round up or down the result to a whole number in step 2.
Since I already knew the correct width from Inspect Element (620 pixels), all I needed to calculate was the correct height of the image (395 pixels).
Now I can edit the code for the image like this:
<img src="image_url" alt="image_alt_text" width="620" height="395" class="alignright size-large" />
Note that I changed three things: the width, the height, and the class of the image.
The large version of the image will be now displayed, even though WordPress didn’t originally offer me this image size.
Liked this post?
Subscribe to our newsletter to receive early notification of new posts and deals: