WordPress Complete(Sixth Edition)
上QQ阅读APP看书,第一时间看更新

Controlling default image sizes

You may be wondering about those image sizes that I mentioned a couple of paragraphs earlier. What if you want bigger or smaller thumbnails? Whenever you upload an image, WordPress creates three versions of that image for you. You can set the pixel dimensions of those three versions by opening Settings in the main sidebar menu, and then clicking on Media. This takes you to the Media Settings page:

Here, you can specify the size of the uploaded images for the following:

  • Thumbnail size
  • Medium size
  • Large size

If you change the dimensions on this page and click on the Save Changes button, only the images you upload in the future will be affected. Images you've already uploaded to the site will stay at their original thumbnail, medium and large versions. It's a good idea to decide what you want your three media sizes to be early on in your site's lifespan, so you can set them and have them applied to all images, right from the start.

Another thing about uploading images is the craze for HiDPI displays, also called Retina displays, or Ultra High Definition (UHD). Currently, WordPress is a kind of a transitional phase when it comes to images and being in tune with modern display technology; retina-ready functionality was introduced not that long ago in WordPress 3.5. In short, if you want to make your images retina compatible (meaning that they look good on iPads, modern Android phones, and other devices with HiDPI screens), you should upload the images at twice the intended dimensions. For example, if you want your image to be presented as 800 pixels wide and 600 pixels high then upload it as 1600 pixels wide and 1200 pixels high. WordPress will manage to display it properly anyway, and whoever visits your site from a modern device will see a high-definition version of the image. In future versions, WordPress will provide a more managed way of handling retina-compatible images.